def test_register_resource_type_bad_rt_attempted_override(self): test_profile = {'latest': {ResourceType.MGMT_STORAGE: '2020-10-10'}} with mock.patch('azure.cli.core.profiles.API_PROFILES', test_profile): with self.assertRaises(TypeError): register_resource_type('doesnotexist', ResourceType.MGMT_STORAGE, '2020-12-12-preview')
def test_register_resource_type_bad_profile(self): test_profile = {'latest': {ResourceType.MGMT_STORAGE: '2020-10-10'}} with mock.patch('azure.cli.core.profiles.API_PROFILES', test_profile): custom_rt = CustomResourceType('mysdkpath', 'myClient') with self.assertRaises(ValueError): register_resource_type('doesnotexist', custom_rt, '2020-12-12-preview')
def test_register_resource_type_valid(self): test_profile = {'latest': {ResourceType.MGMT_STORAGE: '2020-10-10'}} with mock.patch('azure.cli.core.profiles.API_PROFILES', test_profile): custom_rt = CustomResourceType('mysdkpath', 'myClient') register_resource_type('latest', custom_rt, '2020-12-12-preview') from azure.cli.core.profiles import API_PROFILES self.assertDictEqual(API_PROFILES, {'latest': {ResourceType.MGMT_STORAGE: '2020-10-10', custom_rt: '2020-12-12-preview'}})
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type('latest', CUSTOM_MGMT_AKS_PREVIEW, '2020-04-01') acs_custom = CliCommandType(operations_tmpl='azext_aks_preview.custom#{}') super(ContainerServiceCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=acs_custom, resource_type=CUSTOM_MGMT_AKS_PREVIEW)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from .profiles import CUSTOM_ER register_resource_type('latest', CUSTOM_ER, '2018-08-01') super(ExpressRouteCommandsLoader, self).__init__( cli_ctx=cli_ctx, custom_command_type=CliCommandType( operations_tmpl='azext_express_route.custom#{}'), resource_type=CUSTOM_ER)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type('latest', CUSTOM_MGMT_APPSERVICE, '2019-08-01') appservice_kube_custom = CliCommandType( operations_tmpl='azext_appservice_kube.custom#{}') super(AppserviceCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=appservice_kube_custom, resource_type=CUSTOM_MGMT_APPSERVICE)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type('latest', CUSTOM_MGMT_AKS_PREVIEW, '2019-04-01') acs_custom = CliCommandType(operations_tmpl='azext_aks_preview.custom#{}') super(ContainerServiceCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=acs_custom, resource_type=CUSTOM_MGMT_AKS_PREVIEW, min_profile='2017-03-10-profile')
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from .profiles import CUSTOM_FIREWALL register_resource_type('latest', CUSTOM_FIREWALL, '2021-08-01') super().__init__(cli_ctx=cli_ctx, custom_command_type=CliCommandType( operations_tmpl='azext_firewall.custom#{}'), resource_type=CUSTOM_FIREWALL)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from .profiles import CUSTOM_ER_CC register_resource_type('latest', CUSTOM_ER_CC, '2018-04-01') super(ExpressRouteCrossConnectionCommandsLoader, self).__init__( cli_ctx=cli_ctx, custom_command_type=CliCommandType(operations_tmpl='azext_expressroutecrossconnection.custom#{}'), resource_type=CUSTOM_ER_CC )
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type('latest', CUSTOM_MGMT_STORAGE_ORS, '2019-06-01') storage_custom = CliCommandType(operations_tmpl='azext_storage_ors_preview.custom#{}') super(StorageCommandsLoader, self).__init__(cli_ctx=cli_ctx, resource_type=CUSTOM_MGMT_STORAGE_ORS, custom_command_type=storage_custom)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from .profiles import CUSTOM_VWAN register_resource_type('latest', CUSTOM_VWAN, '2018-08-01') super(VirtualWanCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=CliCommandType( operations_tmpl='azext_vwan.custom#{}'), resource_type=CUSTOM_VWAN)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from .profiles import CUSTOM_FIREWALL register_resource_type('latest', CUSTOM_FIREWALL, '2018-08-01') super(AzureFirewallCommandsLoader, self).__init__( cli_ctx=cli_ctx, custom_command_type=CliCommandType(operations_tmpl='azext_firewall.custom#{}'), resource_type=CUSTOM_FIREWALL )
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type('latest', CUSTOM_DATA_STORAGE_BLOB, '2020-02-10') register_resource_type('latest', CUSTOM_MGMT_STORAGE, '2021-01-01') storage_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.storage.custom#{}') super(StorageCommandsLoader, self).__init__(cli_ctx=cli_ctx, resource_type=CUSTOM_DATA_STORAGE_BLOB, custom_command_type=storage_custom, command_group_cls=StorageCommandGroup, argument_context_cls=StorageArgumentContext)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from .profiles import CUSTOM_FIREWALL, CUSTOM_FIREWALL_POLICY register_resource_type('latest', CUSTOM_FIREWALL, '2019-09-01') register_resource_type('latest', CUSTOM_FIREWALL_POLICY, '2019-07-01') super(AzureFirewallCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=CliCommandType( operations_tmpl='azext_firewall.custom#{}'), resource_type=CUSTOM_FIREWALL)
def test_register_resource_type_valid(self): test_profile = {'latest': {ResourceType.MGMT_STORAGE: '2020-10-10'}} with mock.patch('azure.cli.core.profiles.API_PROFILES', test_profile): custom_rt = CustomResourceType('mysdkpath', 'myClient') register_resource_type('latest', custom_rt, '2020-12-12-preview') from azure.cli.core.profiles import API_PROFILES self.assertDictEqual( API_PROFILES, { 'latest': { ResourceType.MGMT_STORAGE: '2020-10-10', custom_rt: '2020-12-12-preview' } })
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type('latest', CUSTOM_DATA_STORAGE, '2017-11-09') storage_custom = CliCommandType( operations_tmpl='azext_storage_preview.custom#{}') super(StorageCommandsLoader, self).__init__(cli_ctx=cli_ctx, resource_type=CUSTOM_DATA_STORAGE, custom_command_type=storage_custom, command_group_cls=StorageCommandGroup, argument_context_cls=StorageArgumentContext)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from .profiles import CUSTOM_NW_CONNECTION_MONITOR register_resource_type('latest', CUSTOM_NW_CONNECTION_MONITOR, '2019-11-01') nw_connection_monitor = CliCommandType( operations_tmpl='azext_connection_monitor_preview.custom#{}', client_factory=cf_nw_connection_monitor ) super(NWConnectionMonitorCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=nw_connection_monitor, resource_type=CUSTOM_NW_CONNECTION_MONITOR)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from ._client_factory import cf_ip_groups from .profiles import CUSTOM_IP_GROUPS register_resource_type('latest', CUSTOM_IP_GROUPS, '2019-09-01') ip_groups_custom = CliCommandType( operations_tmpl='azext_ip_group.custom#{}', client_factory=cf_ip_groups) super(IpGroupsCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=ip_groups_custom, resource_type=CUSTOM_IP_GROUPS)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type( "latest", CUSTOM_MGMT_AKS_PREVIEW, SDKProfile("2021-05-01", {"container_services": "2017-07-01"}), ) acs_custom = CliCommandType( operations_tmpl='azext_aks_preview.custom#{}') super(ContainerServiceCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=acs_custom, resource_type=CUSTOM_MGMT_AKS_PREVIEW)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type('latest', CUSTOM_DATA_STORAGE, '2018-03-28') register_resource_type('latest', CUSTOM_DATA_STORAGE_ADLS, '2019-02-02-preview') register_resource_type('latest', CUSTOM_MGMT_STORAGE, '2021-08-01') register_resource_type('latest', CUSTOM_DATA_STORAGE_FILESHARE, '2020-02-10') register_resource_type('latest', CUSTOM_DATA_STORAGE_FILEDATALAKE, '2020-06-12') storage_custom = CliCommandType(operations_tmpl='azext_storage_preview.custom#{}') super(StorageCommandsLoader, self).__init__(cli_ctx=cli_ctx, resource_type=CUSTOM_DATA_STORAGE, custom_command_type=storage_custom, command_group_cls=StorageCommandGroup, argument_context_cls=StorageArgumentContext)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type('latest', CUSTOM_DATA_STORAGE, '2018-03-28') register_resource_type('latest', CUSTOM_MGMT_STORAGE, '2018-07-01') register_resource_type('latest', CUSTOM_MGMT_PREVIEW_STORAGE, '2018-03-01-preview') storage_custom = CliCommandType(operations_tmpl='azext_storage_preview.custom#{}') super(StorageCommandsLoader, self).__init__(cli_ctx=cli_ctx, min_profile='2017-03-10-profile', resource_type=CUSTOM_DATA_STORAGE, custom_command_type=storage_custom, command_group_cls=StorageCommandGroup, argument_context_cls=StorageArgumentContext)
def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType register_resource_type('latest', CUSTOM_DATA_STORAGE, '2018-03-28') register_resource_type('latest', CUSTOM_MGMT_STORAGE, '2018-07-01') register_resource_type('latest', CUSTOM_MGMT_PREVIEW_STORAGE, '2018-03-01-preview') storage_custom = CliCommandType( operations_tmpl='azext_storage_preview.custom#{}') super(StorageCommandsLoader, self).__init__(cli_ctx=cli_ctx, min_profile='2017-03-10-profile', resource_type=CUSTOM_DATA_STORAGE, custom_command_type=storage_custom, command_group_cls=StorageCommandGroup, argument_context_cls=StorageArgumentContext)
def test_register_resource_type_bad_profile(self): test_profile = {'latest': {ResourceType.MGMT_STORAGE: '2020-10-10'}} with mock.patch('azure.cli.core.profiles.API_PROFILES', test_profile): custom_rt = CustomResourceType('mysdkpath', 'myClient') with self.assertRaises(ValueError): register_resource_type('doesnotexist', custom_rt, '2020-12-12-preview')
def __init__(self, ctx): self.ctx = ctx register_resource_type('latest', CUSTOM_DATA_STORAGE, '2018-03-28')
def setUp(self): self.cli = MockCLI() register_resource_type('latest', CUSTOM_MGMT_STORAGE, '2018-07-01')
def test_register_resource_type_bad_rt_attempted_override(self): test_profile = {'latest': {ResourceType.MGMT_STORAGE: '2020-10-10'}} with mock.patch('azure.cli.core.profiles.API_PROFILES', test_profile): with self.assertRaises(TypeError): register_resource_type('doesnotexist', ResourceType.MGMT_STORAGE, '2020-12-12-preview')
def register_aks_preview_resource_type(): register_resource_type( "latest", CUSTOM_MGMT_AKS_PREVIEW, SDKProfile("2021-09-01", {"container_services": "2017-07-01"}), )
# -------------------------------------------------------------------------------------------- # 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.profiles import register_resource_type from ...profiles import CUSTOM_MGMT_PREVIEW_STORAGE register_resource_type('latest', CUSTOM_MGMT_PREVIEW_STORAGE, '2020-08-01-preview')
# -------------------------------------------------------------------------------------------- # 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.profiles import register_resource_type from ...profiles import CUSTOM_MGMT_STORAGE register_resource_type('latest', CUSTOM_MGMT_STORAGE, '2018-02-01')
# -------------------------------------------------------------------------------------------- # 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.profiles import register_resource_type from ...profiles import CUSTOM_MGMT_STORAGE register_resource_type('latest', CUSTOM_MGMT_STORAGE, '2018-03-01-preview')
# -------------------------------------------------------------------------------------------- # 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.profiles import register_resource_type from azext_firewall.profiles import CUSTOM_FIREWALL register_resource_type('latest', CUSTOM_FIREWALL, '2021-08-01')
# ----------------------------------------------------------------------------- # 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.profiles import register_resource_type from ...profiles import CUSTOM_MGMT_STORAGE_ORS register_resource_type('latest', CUSTOM_MGMT_STORAGE_ORS, '2019-06-01')
def setUp(self): self.cli = MockCLI() register_resource_type('latest', CUSTOM_MGMT_STORAGE, '2018-07-01')
# -------------------------------------------------------------------------------------------- # 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.profiles import register_resource_type from ...profiles import CUSTOM_MGMT_STORAGE, CUSTOM_DATA_STORAGE_FILEDATALAKE register_resource_type('latest', CUSTOM_MGMT_STORAGE, '2021-08-01') register_resource_type('latest', CUSTOM_DATA_STORAGE_FILEDATALAKE, '2020-06-12')
# -------------------------------------------------------------------------------------------- # 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.profiles import register_resource_type from ...profiles import CUSTOM_MGMT_PREVIEW_STORAGE, CUSTOM_DATA_STORAGE_FILEDATALAKE register_resource_type('latest', CUSTOM_MGMT_PREVIEW_STORAGE, '2020-08-01-preview') register_resource_type('latest', CUSTOM_DATA_STORAGE_FILEDATALAKE, '2020-06-12')
# -------------------------------------------------------------------------------------------- # 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.profiles import register_resource_type from azext_firewall.profiles import CUSTOM_FIREWALL register_resource_type('latest', CUSTOM_FIREWALL, '2018-08-01')
def __init__(self, ctx): self.ctx = ctx register_resource_type('latest', CUSTOM_DATA_STORAGE, '2018-03-28')