|
| 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 azext_devops.dev.common.arguments import convert_date_string_to_iso8601 |
| 7 | +from azext_devops.dev.team.arguments import load_global_args |
| 8 | + |
| 9 | + |
| 10 | +# pylint: disable=too-many-statements |
| 11 | +def load_migration_arguments(self, _): |
| 12 | + with self.argument_context('devops migrations') as context: |
| 13 | + load_global_args(context) |
| 14 | + context.argument('repository_id', options_list='--repository-id', |
| 15 | + help='ID of the Azure Repos repository (GUID).') |
| 16 | + |
| 17 | + with self.argument_context('devops migrations list') as context: |
| 18 | + context.argument('include_inactive', options_list='--include-inactive', action='store_true', |
| 19 | + help='Include inactive (completed, abandoned, failed) migrations in the results.') |
| 20 | + context.argument('project', options_list='--project', |
| 21 | + help='Optional project name or ID to filter migrations.') |
| 22 | + |
| 23 | + with self.argument_context('devops migrations create') as context: |
| 24 | + context.argument('target_repository', options_list='--target-repository', |
| 25 | + help='Target repository URL (must start with http:// or https://).') |
| 26 | + context.argument('target_owner_user_id', options_list='--target-owner-user-id', |
| 27 | + help='Target repository owner user ID.') |
| 28 | + context.argument('validate_only', options_list='--validate-only', action='store_true', |
| 29 | + help='Create in validate-only mode (pre-migration checks only).') |
| 30 | + context.argument('cutover_date', options_list='--cutover-date', |
| 31 | + type=convert_date_string_to_iso8601, |
| 32 | + help='Scheduled cutover date/time (ISO 8601).') |
| 33 | + context.argument('agent_pool', options_list='--agent-pool', |
| 34 | + help='Agent pool name to use for migration work.') |
| 35 | + context.argument('skip_validation', options_list='--skip-validation', |
| 36 | + help='Validation policies to skip. Accepts either a comma-separated list of ' |
| 37 | + 'policy names (for example, AgentPoolExists,MaxRepoSize) or a non-negative ' |
| 38 | + 'integer bitmask.') |
| 39 | + |
| 40 | + with self.argument_context('devops migrations cutover set') as context: |
| 41 | + context.argument('cutover_date', options_list='--date', |
| 42 | + type=convert_date_string_to_iso8601, |
| 43 | + help='The date and time for cutover (ISO 8601).') |
| 44 | + |
| 45 | + with self.argument_context('devops migrations resume') as context: |
| 46 | + context.argument('validate_only', options_list='--validate-only', action='store_true', |
| 47 | + help='Resume in validate-only mode.') |
| 48 | + context.argument('migration', options_list='--migration', action='store_true', |
| 49 | + help='Promote a succeeded validate-only migration to a full migration ' |
| 50 | + '(sets validateOnly=false and statusRequested=active).') |
0 commit comments