Skip to content

Commit f055fc9

Browse files
helen-afeworkHelen AfeworkVeryEarly
authored
[Az.Migrate] Data replication 2024-09-01 API version and rebranding (#27207)
* Update data-replication API version to 2024-09-01 * Azure local rebranding * Test recodings * More test recording * Added examples * Including document * Pushed help folder * Replaced path to online repo * Updated autorest readme * Rebranding * Added ChangeLog * Rebranding * Changelog * Update ChangeLog formatting and entries * Run some tests liveonly * Create BreakingChangeIssues.csv --------- Co-authored-by: Helen Afework <[email protected]> Co-authored-by: Yabo Hu <[email protected]>
1 parent 43a7747 commit f055fc9

File tree

113 files changed

+3848
-3326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+3848
-3326
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
13+
14+
using System;
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Migrate")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.6.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("2.6.0")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]
27+
28+

src/Migrate/Migrate.Autorest/README.md

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ In this directory, run AutoRest:
4545
4646
``` yaml
4747
skip-semantics-validation: true
48-
commit: 3b19762dab3c48c857ae2355da351b32dde22eda
48+
commit: 473d98be4cc2fb14db8bddbba8d3184d0aa49636
4949
require:
5050
- $(this-folder)/../../readme.azure.noprofile.md
5151
input-file:
5252
- $(repo)/specification/migrate/resource-manager/Microsoft.OffAzure/stable/2020-01-01/migrate.json
5353
- $(repo)/specification/migrateprojects/resource-manager/Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
5454
- $(repo)/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2024-01-01/service.json
55-
- $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
55+
- $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
5656

57-
module-version: 1.0.1
57+
module-version: 3.0.10
5858
title: Migrate
5959
subject-prefix: 'Migrate'
6060

@@ -114,9 +114,13 @@ directive:
114114
- ProtectedItemModelCustomProperties
115115
- HyperVToAzStackHCIProtectedItemModelCustomProperties
116116
- VMwareToAzStackHCIProtectedItemModelCustomProperties
117+
- ProtectedItemModelPropertiesUpdate
118+
- ProtectedItemModelCustomPropertiesUpdate
119+
- HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate
120+
- VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate
117121
- PlannedFailoverModelProperties
118-
- WorkflowModelProperties
119-
- WorkflowModelCustomProperties
122+
- JobModelProperties
123+
- JobModelCustomProperties
120124
- TaskModel
121125
- TaskModelCustomProperties
122126
# Remove variants not in scope
@@ -240,7 +244,7 @@ directive:
240244
remove: true
241245
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
242246
where:
243-
subject: ^Job|^VMwareOperationsStatus
247+
subject: ^VMwareOperationsStatus
244248
remove: true
245249
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
246250
where:
@@ -328,48 +332,62 @@ directive:
328332
verb: New|Remove|Update
329333
subject: ^HyperV
330334
remove: true
331-
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
335+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
332336
where:
333337
verb: Test|Invoke
334338
subject: NameAvailability$|DeploymentPreflight
335339
remove: true
336-
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
340+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
337341
where:
338342
verb: Get|New
339343
subject: ^EmailConfiguration
340344
remove: true
341-
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
345+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
342346
where:
343347
verb: Get
344-
subject: ^(Dra|ProtectedItem|Vault|Workflow)OperationStatus$
348+
subject: ^(FabricAgent|ProtectedItem|Vault|Job)OperationStatus$
345349
remove: true
346-
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
350+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
347351
where:
348352
verb: Get
349353
subject: ^FabricOperationsStatus$
350354
remove: true
351-
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
355+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
352356
where:
353357
verb: New
354-
subject: ^(Dra|Vault)
358+
subject: ^(FabricAgent|Vault)
355359
remove: true
356-
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
360+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
357361
where:
358362
verb: Update
359363
subject: ^Vault
360364
remove: true
365+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
366+
where:
367+
subject: PrivateEndpointConnection|PrivateLinkResource
368+
remove: true
369+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
370+
where:
371+
subject: OperationResult
372+
remove: true
361373
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
362374
where:
363375
verb: Invoke
364376
subject: ^PlannedReplication
365377
remove: true
366-
# Rename cmdlets for AzStackHCI
367-
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
378+
# Rename cmdlets for Azure Local
379+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
368380
where:
369381
verb: Get
370382
subject: ^Fabric$
371383
set:
372-
subject: HCIReplicationFabric
384+
subject: LocalReplicationFabric
385+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
386+
where:
387+
verb: Get
388+
subject: ^Job$
389+
set:
390+
subject: LocalReplicationJob
373391
# Hide cmldets used by custom
374392
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
375393
where:
@@ -464,10 +482,10 @@ directive:
464482
verb: New$
465483
variant: ^CreateViaIdentity
466484
hide: true
467-
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
485+
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
468486
where:
469487
verb: Get$|Invoke$|New$|Remove$|Test$|Update$
470-
subject: ^Dra|^Fabric|^Policy|^EmailConfiguration|^ProtectedItem|^ReplicationExtension|^Vault|^Workflow
488+
subject: ^FabricAgent|^Fabric|^Policy|^EmailConfiguration|^ProtectedItem|^ReplicationExtension|^Vault
471489
hide: true
472490
- where:
473491
verb: New$|Set$|Update$

src/Migrate/Migrate.Autorest/UX/Microsoft.DataReplication/replicationFabrics.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"resourceType": "replicationFabrics",
3-
"apiVersion": "2021-02-16-preview",
3+
"apiVersion": "2024-09-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
66
},
77
"commands": [
88
{
9-
"name": "Get-AzMigrateHCIReplicationFabric",
9+
"name": "Get-AzMigrateLocalReplicationFabric",
1010
"description": "Gets the details of the fabric.",
1111
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}",
1212
"help": {
1313
"learnMore": {
14-
"url": "https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehcireplicationfabric"
14+
"url": "https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratelocalreplicationfabric"
1515
},
1616
"parameterSets": [
1717
{

src/Migrate/Migrate.Autorest/custom/AzStackHCIDiskInput.cs renamed to src/Migrate/Migrate.Autorest/custom/AzLocalDiskInput.cs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,46 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
using System;
34

4-
namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview
5+
namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901
56
{
6-
public class AzStackHCIDiskInput
7+
public class AzLocalDiskInput
78
{
8-
public AzStackHCIDiskInput(
9+
public AzLocalDiskInput(
910
string diskId,
1011
bool isDynamic,
1112
long diskSizeGB,
1213
string diskFileFormat,
13-
bool isOsDisk)
14+
bool isOsDisk,
15+
long? diskPhysicalSectorSize,
16+
string storageContainerId)
1417
{
1518
DiskId = diskId;
1619
IsDynamic = isDynamic;
1720
DiskSizeGb = diskSizeGB;
1821
DiskFileFormat = diskFileFormat;
1922
IsOSDisk = isOsDisk;
23+
24+
DiskPhysicalSectorSize =
25+
(diskPhysicalSectorSize == 512 || diskPhysicalSectorSize == 4096)
26+
? diskPhysicalSectorSize
27+
: null;
28+
29+
// TODO(helenafework): Add this code back once backend is fixed to check for empty string
30+
// StorageContainerId =
31+
// string.IsNullOrWhiteSpace(storageContainerId)
32+
// ? null
33+
// : storageContainerId;
2034
}
2135

2236
/// <summary>Gets or sets the type of the virtual hard disk, vhd or vhdx.</summary>
2337
public string DiskFileFormat { get; set; }
2438

2539
/// <summary>Gets or sets the disk Id.</summary>
2640
public string DiskId { get; set; }
41+
42+
/// <summary>Gets or sets a value of disk physical sector size.</summary>
43+
public long? DiskPhysicalSectorSize { get; set;}
2744

2845
/// <summary>Gets or sets the disk size in GB.</summary>
2946
public long DiskSizeGb { get; set; }
@@ -36,5 +53,8 @@ public AzStackHCIDiskInput(
3653

3754
/// <summary>Gets or sets a value indicating whether disk is os disk.</summary>
3855
public bool IsOSDisk { get; set; }
56+
57+
// /// <summary>Gets or sets the target storage account ARM Id.</summary>
58+
// public string StorageContainerId { get; set; }
3959
}
4060
}

src/Migrate/Migrate.Autorest/custom/AzStackHCINicInput.cs renamed to src/Migrate/Migrate.Autorest/custom/AzLocalNicInput.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4-
namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview
4+
namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901
55
{
6-
public class AzStackHCINicInput
6+
public class AzLocalNicInput
77
{
8-
public AzStackHCINicInput(
8+
public AzLocalNicInput(
99
string nicId,
1010
string targetNetworkId,
1111
string testNetworkId,
@@ -20,10 +20,10 @@ public AzStackHCINicInput(
2020
/// <summary>Gets or sets the NIC Id.</summary>
2121
public string NicId { get; set; }
2222

23-
/// <summary>Gets or sets the target network Id within AzStackHCI Cluster.</summary>
23+
/// <summary>Gets or sets the target network Id within Azure Local Cluster.</summary>
2424
public string TargetNetworkId { get; set; }
2525

26-
/// <summary>Gets or sets the target test network Id within AzStackHCI Cluster.</summary>
26+
/// <summary>Gets or sets the target test network Id within Azure Local Cluster.</summary>
2727
public string TestNetworkId { get; set; }
2828

2929
/// <summary>Gets or sets the selection type of the NIC.</summary>

src/Migrate/Migrate.Autorest/custom/Get-AzMigrateHCIJob.ps1 renamed to src/Migrate/Migrate.Autorest/custom/Get-AzMigrateLocalJob.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
.Synopsis
1818
Retrieves the status of an Azure Migrate job.
1919
.Description
20-
The Get-AzMigrateHCIJob cmdlet retrives the status of an Azure Migrate job.
20+
The Get-AzMigrateLocalJob cmdlet retrives the status of an Azure Migrate job.
2121
.Link
22-
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehcijob
22+
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratelocaljob
2323
#>
24-
function Get-AzMigrateHCIJob {
25-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel])]
24+
function Get-AzMigrateLocalJob {
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
26+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IJobModel])]
2627
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
2728
param(
2829
[Parameter(ParameterSetName = 'GetById', Mandatory)]
@@ -183,6 +184,6 @@ function Get-AzMigrateHCIJob {
183184
$null = $PSBoundParameters.Add('JobName', $Name)
184185
}
185186

186-
return Az.Migrate.Internal\Get-AzMigrateWorkflow @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
187+
return Az.Migrate.Internal\Get-AzMigrateLocalReplicationJob @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
187188
}
188189
}

src/Migrate/Migrate.Autorest/custom/Get-AzMigrateHCIServerReplication.ps1 renamed to src/Migrate/Migrate.Autorest/custom/Get-AzMigrateLocalServerReplication.ps1

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
.Synopsis
1818
Retrieves the details of the replicating server.
1919
.Description
20-
The Get-AzMigrateHCIServerReplication cmdlet retrieves the object for the replicating server.
20+
The Get-AzMigrateLocalServerReplication cmdlet retrieves the object for the replicating server.
2121
.Link
22-
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehciserverreplication
22+
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratelocalserverreplication
2323
#>
24-
function Get-AzMigrateHCIServerReplication {
25-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IProtectedItemModel])]
24+
function Get-AzMigrateLocalServerReplication {
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
26+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IProtectedItemModel])]
2627
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
2728
param(
2829
[Parameter(ParameterSetName = 'GetByItemID', Mandatory)]
@@ -131,7 +132,7 @@ function Get-AzMigrateHCIServerReplication {
131132
)
132133

133134
process {
134-
Import-Module $PSScriptRoot\Helper\AzStackHCICommonSettings.ps1
135+
Import-Module $PSScriptRoot\Helper\AzLocalCommonSettings.ps1
135136

136137
$parameterSet = $PSCmdlet.ParameterSetName
137138
$null = $PSBoundParameters.Remove('TargetObjectID')
@@ -194,7 +195,7 @@ function Get-AzMigrateHCIServerReplication {
194195

195196
$VaultName = $solution.DetailExtendedDetail.AdditionalProperties.vaultId.Split("/")[8]
196197
if ([string]::IsNullOrEmpty($VaultName)) {
197-
throw "Azure Migrate Project not configured: missing replication vault. Setup Azure Migrate Project and run the Initialize-AzMigrateHCIReplicationInfrastructure script before proceeding."
198+
throw "Azure Migrate Project not configured: missing replication vault. Setup Azure Migrate Project and run the Initialize-AzMigrateLocalReplicationInfrastructure script before proceeding."
198199
}
199200

200201
$null = $PSBoundParameters.Add("VaultName", $VaultName)
@@ -236,7 +237,7 @@ function Get-AzMigrateHCIServerReplication {
236237

237238
$VaultName = $solution.DetailExtendedDetail.AdditionalProperties.vaultId.Split("/")[8]
238239
if ([string]::IsNullOrEmpty($VaultName)) {
239-
throw "Azure Migrate Project not configured: missing replication vault. Setup Azure Migrate Project and run the Initialize-AzMigrateHCIReplicationInfrastructure script before proceeding."
240+
throw "Azure Migrate Project not configured: missing replication vault. Setup Azure Migrate Project and run the Initialize-AzMigrateLocalReplicationInfrastructure script before proceeding."
240241
}
241242

242243
$null = $PSBoundParameters.Add("VaultName", $VaultName)

src/Migrate/Migrate.Autorest/custom/Helper/AzStackHCICommonSettings.ps1 renamed to src/Migrate/Migrate.Autorest/custom/Helper/AzLocalCommonSettings.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
$AzStackHCIInstanceTypes = @{
2-
HyperVToAzStackHCI = "HyperVToAzStackHCI";
3-
VMwareToAzStackHCI = "VMwareToAzStackHCI";
1+
$AzLocalInstanceTypes = @{
2+
HyperVToAzLocal = "HyperVToAzStackHCI";
3+
VMwareToAzLocal = "VMwareToAzStackHCI";
44
}
55

66
# Fabric instances
77
$FabricInstanceTypes = @{
88
HyperVInstance = "HyperVMigrate";
99
VMwareInstance = "VMwareMigrate";
10-
AzStackHCIInstance = "AzStackHCI";
10+
AzLocalInstance = "AzStackHCI";
1111
}
1212

1313
$ReplicationDetails = @{
@@ -27,7 +27,7 @@ $ApiVersions = @{
2727
StorageAccount = "2021-09-01";
2828
HyperVSites = "2020-01-01";
2929
ProtectedItem = "2021-02-16-preview";
30-
AzStackHCI = "2021-09-01-preview";
30+
AzLocal = "2021-09-01-preview";
3131
}
3232

3333
# Role definition GUIDs for storage account creation

0 commit comments

Comments
 (0)