-
Notifications
You must be signed in to change notification settings - Fork 267
Expand file tree
/
Copy pathcommands.py
More file actions
29 lines (23 loc) · 1.71 KB
/
commands.py
File metadata and controls
29 lines (23 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# --------------------------------------------------------------------------------------------
# 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.commands import CliCommandType
from azext_devops.dev.common.exception_handler import azure_devops_exception_handler
from ._format import transform_migrations_table_output, transform_migration_table_output
migrationOps = CliCommandType(
operations_tmpl='azext_devops.dev.migration.migration#{}',
exception_handler=azure_devops_exception_handler
)
def load_migration_commands(self, _):
with self.command_group('devops migrations', command_type=migrationOps) as g:
g.command('list', 'list_migrations', table_transformer=transform_migrations_table_output)
g.command('status', 'get_migration', table_transformer=transform_migration_table_output)
g.command('create', 'create_migration', table_transformer=transform_migration_table_output)
g.command('pause', 'pause_migration', table_transformer=transform_migration_table_output)
g.command('resume', 'resume_migration', table_transformer=transform_migration_table_output)
g.command('abandon', 'delete_migration',
confirmation='Are you sure you want to abandon this migration?')
with self.command_group('devops migrations cutover', command_type=migrationOps) as g:
g.command('set', 'schedule_cutover', table_transformer=transform_migration_table_output)
g.command('cancel', 'cancel_cutover', table_transformer=transform_migration_table_output)