|
| 1 | +# -------------------------------------------------------------------------------------------- |
| 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +# Licensed under the MIT License. See License.txt in the project root for license information. |
| 4 | +# -------------------------------------------------------------------------------------------- |
| 5 | + |
| 6 | +from azure.cli.core.commands import CliCommandType |
| 7 | +from azure.cli.command_modules.acr._client_factory import cf_acr_registries |
| 8 | +from azure.cli.command_modules.acr._format import endpoints_output_format, registry_output_format |
| 9 | +from azext_acrregionalendpoint._client_factory import cf_acrregionalendpoint |
| 10 | + |
| 11 | + |
| 12 | +def load_command_table_preview(self, _): |
| 13 | + acr_custom_util = CliCommandType( |
| 14 | + operations_tmpl='azext_acrregionalendpoint.custom#{}', |
| 15 | + table_transformer=registry_output_format, |
| 16 | + client_factory=cf_acrregionalendpoint |
| 17 | + ) |
| 18 | + |
| 19 | + acr_login_util = CliCommandType( |
| 20 | + operations_tmpl='azext_acrregionalendpoint.custom#{}' |
| 21 | + ) |
| 22 | + |
| 23 | + acr_import_util = CliCommandType( |
| 24 | + operations_tmpl='azext_acrregionalendpoint.import#{}', |
| 25 | + client_factory=cf_acr_registries |
| 26 | + ) |
| 27 | + |
| 28 | + with self.command_group('acr', acr_custom_util) as g: |
| 29 | + g.command('create', 'acr_create_preview') |
| 30 | + g.show_command('show', 'acr_show_preview') |
| 31 | + g.generic_update_command('update', |
| 32 | + getter_name='acr_update_get_preview', |
| 33 | + setter_name='acr_update_set_preview', |
| 34 | + custom_func_name='acr_update_custom_preview', |
| 35 | + custom_func_type=acr_custom_util, |
| 36 | + client_factory=cf_acrregionalendpoint) |
| 37 | + g.command('show-endpoints', 'acr_show_endpoints_preview', table_transformer=endpoints_output_format) |
| 38 | + |
| 39 | + with self.command_group('acr', acr_login_util) as g: |
| 40 | + g.command('login', 'acr_login_preview') |
| 41 | + |
| 42 | + with self.command_group('acr', acr_import_util) as g: |
| 43 | + g.command('import', 'acr_import_preview', supports_no_wait=True) |
0 commit comments