Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/migrate/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Release History
+++++++++++++++
* New version.

2.0.0b1
+++++++++++++++
* Switch to experimental version.
113 changes: 113 additions & 0 deletions src/migrate/azext_migrate/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,116 @@
--target-test-virtual-switch-id "XYXY" \\
--os-disk-id "disk-0"
"""

helps['migrate local replication remove'] = """
type: command
short-summary: Stop replication for a migrated server.
long-summary: |
Stops the replication for a migrated server and removes
the replication configuration.
This command disables protection for the specified server.

Note: This command uses a preview API version
and may experience breaking changes in future releases.
parameters:
- name: --target-object-id --id
short-summary: Replicating server ARM ID to disable replication.
long-summary: >
Specifies the ARM resource ID of the replicating server
for which replication needs to be disabled.
The ID should be retrieved using a get or list command
for replication items.
- name: --force-remove --force
short-summary: Force remove the replication.
long-summary: >
Specifies whether the replication needs to be
force removed. Default is false.
Use this option to remove replication even if
the cleanup process encounters errors.
- name: --subscription-id
short-summary: Azure subscription ID.
long-summary: >
The subscription containing the replication resources.
Uses the current subscription if not specified.
examples:
- name: Stop replication for a migrated server
text: |
az migrate local replication remove \\
--target-object-id "XXXX"
- name: Force remove replication for a server
text: |
az migrate local replication remove \\
--target-object-id "XXXX" \\
--force-remove true
- name: Stop replication using short parameter names
text: |
az migrate local replication remove \\
--id "XXXX" \\
--force
"""

helps['migrate local replication get-job'] = """
type: command
short-summary: Retrieve the status of an Azure Migrate job.
long-summary: |
Get the status and details of an Azure Migrate replication job.
You can retrieve a specific job by its ARM ID or name,
or list all jobs in a migrate project.

Note: This command uses a preview API version
and may experience breaking changes in future releases.
parameters:
- name: --job-id --id
short-summary: Job ARM ID for which details need to be retrieved.
long-summary: >
Specifies the full ARM resource ID of the job.
When provided, retrieves the specific job details.
- name: --resource-group-name --resource-group -g
short-summary: Resource group name where the vault is present.
long-summary: >
The name of the resource group containing
the recovery services vault.
Required when using --project-name.
- name: --project-name
short-summary: Name of the migrate project.
long-summary: >
The name of the Azure Migrate project.
Required when using --resource-group-name.
- name: --job-name --name
short-summary: Job identifier/name.
long-summary: >
The name of the specific job to retrieve.
If not provided, lists all jobs in the project.
- name: --subscription-id
short-summary: Azure subscription ID.
long-summary: >
The subscription containing the migrate project.
Uses the current subscription if not specified.
examples:
- name: Get a specific job by ARM ID
text: |
az migrate local replication get-job \\
--job-id "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.DataReplication/replicationVaults/{vault}/jobs/{job-name}"
- name: Get a specific job by name
text: |
az migrate local replication get-job \\
--resource-group-name myRG \\
--project-name myMigrateProject \\
--job-name myJobName
- name: List all jobs in a project
text: |
az migrate local replication get-job \\
--resource-group-name myRG \\
--project-name myMigrateProject
- name: Get job using short parameter names
text: |
az migrate local replication get-job \\
--id "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.DataReplication/replicationVaults/{vault}/jobs/{job-name}"
- name: Get job with specific subscription
text: |
az migrate local replication get-job \\
-g myRG \\
--project-name myMigrateProject \\
--name myJobName \\
--subscription-id "12345678-1234-1234-1234-123456789012"
"""
38 changes: 37 additions & 1 deletion src/migrate/azext_migrate/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def load_arguments(self, _):
with self.argument_context('migrate') as c:
c.argument('subscription_id', subscription_id_type)

with self.argument_context('migrate local get-discovered-server') as c:
with self.argument_context('migrate get-discovered-server') as c:
c.argument('project_name', project_name_type, required=True)
c.argument(
'resource_group_name',
Expand Down Expand Up @@ -183,3 +183,39 @@ def load_arguments(self, _):
'scenario.',
required=True)
c.argument('subscription_id', subscription_id_type)

with self.argument_context('migrate local replication remove') as c:
c.argument(
'target_object_id',
options_list=['--target-object-id', '--id'],
help='Specifies the replicating server ARM ID for which '
'replication needs to be disabled. The ID should be '
'retrieved using the get command.')
c.argument(
'force_remove',
options_list=['--force-remove', '--force'],
arg_type=get_three_state_flag(),
help='Specifies whether the replication needs to be force '
'removed. Default is false.')
c.argument('subscription_id', subscription_id_type)

with self.argument_context('migrate local replication get-job') as c:
c.argument(
'job_id',
options_list=['--job-id', '--id'],
help='Specifies the job ARM ID for which the details need to '
'be retrieved.')
c.argument(
'resource_group_name',
options_list=['--resource-group-name', '--resource-group', '-g'],
help='The name of the resource group where the recovery '
'services vault is present.')
c.argument(
'project_name',
project_name_type,
help='The name of the migrate project.')
c.argument(
'job_name',
options_list=['--job-name', '--name'],
help='Job identifier.')
c.argument('subscription_id', subscription_id_type)
3 changes: 2 additions & 1 deletion src/migrate/azext_migrate/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"azext.minCliCoreVersion": "2.75.0"
"azext.minCliCoreVersion": "2.75.0",
"azext.isPreview": true
}
4 changes: 3 additions & 1 deletion src/migrate/azext_migrate/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

def load_command_table(self, _):
# Azure Local Migration Commands
with self.command_group('migrate local') as g:
with self.command_group('migrate') as g:
g.custom_command('get-discovered-server', 'get_discovered_server')

with self.command_group('migrate local replication') as g:
g.custom_command('init', 'initialize_replication_infrastructure')
g.custom_command('new', 'new_local_server_replication')
g.custom_command('remove', 'remove_local_server_replication')
g.custom_command('get-job', 'get_local_replication_job')
Loading
Loading