Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Migrate from generation to main #26407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2,600 changes: 1,625 additions & 975 deletions src/Migrate/Migrate.Autorest/Az.Migrate.format.ps1xml

Large diffs are not rendered by default.

74 changes: 37 additions & 37 deletions src/Migrate/Migrate.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ In this directory, run AutoRest:

``` yaml
skip-semantics-validation: true
commit: 0dd49a444195fef7f3555cad038cb7665cbd928c
commit: 3b19762dab3c48c857ae2355da351b32dde22eda
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/migrate/resource-manager/Microsoft.OffAzure/stable/2020-01-01/migrate.json
- $(repo)/specification/migrateprojects/resource-manager/Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
- $(repo)/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/service.json
- $(repo)/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2024-01-01/service.json
- $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json

module-version: 1.0.1
Expand Down Expand Up @@ -120,55 +120,55 @@ directive:
- TaskModel
- TaskModelCustomProperties
# Remove variants not in scope
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Test$
subject: ^ReplicationMigrationItemMigrate
variant: ^TestViaIdentity$|^TestViaIdentityExpanded$|^Test$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Get$
subject: ReplicationFabric$|ReplicationPolicy$|ReplicationProtectionContainer$|ReplicationMigrationItem$|ReplicationJob$|ReplicationProtectionContainerMapping$|ReplicationRecoveryServicesProvider$
variant: ^GetViaIdentity$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Remove$
subject: ^ReplicationMigrationItem
variant: ^DeleteViaIdentity$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Move$
subject: ^ReplicationMigrationItem
variant: ^MigrateViaIdentityExpanded$|^Migrate$|^MigrateViaIdentity$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Suspend$
subject: ^ReplicationMigrationItemReplication
variant: ^PauseViaIdentityExpanded$|^Pause$|^PauseViaIdentity$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Resume$
subject: ^ReplicationMigrationItemReplication
variant: ^ResumeViaIdentityExpanded$|^Resume$|^ResumeViaIdentity$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Invoke$
subject: ^ResyncReplicationMigrationItem
variant: ^ResyncViaIdentityExpanded$|^ResyncViaIdentity$|^Resync$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: New$
subject: ^ReplicationMigrationItem|ReplicationProtectionContainerMapping$|ReplicationPolicy$
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Create$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Update$
subject: ^ReplicationMigrationItem
Expand Down Expand Up @@ -266,49 +266,49 @@ directive:
verb: Update$
subject: Project$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
subject: ^ReplicationRecoveryPlan|ReplicationRecoveryServiceProvider$|ReplicationEvent$|ReplicationAlertSetting$|ReplicationLogicalNetwork$|^ReplicationProtectedItem|^ReplicationNetwork|^ReplicationStorage|RecoveryPoint$|ProtectableItem$|FabricGateway$|FabricToAad$|ReplicationvCenter$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Export$|Find$|Switch$|Clear$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
subject: ^Commit|^Renew|^Reprotect|^Unplanned|VaultHealth$|ComputeSize$|FabricConsistency$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: New$|Remove$
subject: Fabric$|ProtectionContainer$|ReplicationRecoveryServicesProvider$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Remove$
subject: ReplicationPolicy$|ReplicationProtectionContainerMapping$
subject: ReplicationPolicy$|ReplicationProtectionContainerMapping$|ReplicationFabricInfra$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Update$
subject: Fabric$|Policy$|ProtectionContainer$|ReplicationProtectionContainerMapping$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Stop$|Resume$|Restart$
subject: Job$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Get
subject: ^ReplicationAppliance|^ReplicationEligibilityResult|^ReplicationProtectionIntent
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Get
subject: ^ReplicationVaultSetting|^SupportedOperatingSystem|^ReplicationProtectionIntent
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: New
subject: ^ReplicationVaultSetting|^SupportedOperatingSystem|^ReplicationProtectionIntent
Expand Down Expand Up @@ -358,7 +358,7 @@ directive:
verb: Update
subject: ^Vault
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Invoke
subject: ^PlannedReplication
Expand All @@ -376,57 +376,57 @@ directive:
verb: Set$
subject: ^Solution
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Get$
subject: ToAzureMigrate$
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Get$
subject: ReplicationMigrationItem$|ReplicationJob$
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Test$
subject: ^ReplicationMigrationItemMigrate
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: New$|Remove$
subject: ^ReplicationMigrationItem
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Move$
subject: ^ReplicationMigrationItem
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Restart$
subject: ^ReplicationJob
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Invoke$
subject: ^ResyncReplicationMigrationItem
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Update$
subject: ^ReplicationMigrationItem
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Suspend$
subject: ^ReplicationMigrationItemReplication
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Resume$
subject: ^ReplicationMigrationItemReplication
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
subject: ^Planned
hide: true
Expand Down Expand Up @@ -475,17 +475,17 @@ directive:
parameter-name: Name
clear-alias: true
# Table output formatting
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
model-name: MigrationItem
set:
suppress-format: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
model-name: Job
set:
suppress-format: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
model-name: Fabric
set:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings",
"apiVersion": "2023-01-01",
"apiVersion": "2024-01-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "vaults/replicationFabrics/replicationProtectionContainers",
"apiVersion": "2023-01-01",
"apiVersion": "2024-01-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "vaults/replicationFabrics/replicationRecoveryServicesProviders",
"apiVersion": "2023-01-01",
"apiVersion": "2024-01-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "vaults/replicationPolicies",
"apiVersion": "2023-01-01",
"apiVersion": "2024-01-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
},
Expand Down
7 changes: 4 additions & 3 deletions src/Migrate/Migrate.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ if(-not $Isolated -and -not $Debugger) {
$binFolder = Join-Path $PSScriptRoot 'bin'
$objFolder = Join-Path $PSScriptRoot 'obj'

$isAzure = [System.Convert]::ToBoolean('true')

if(-not $Debugger) {
Write-Host -ForegroundColor Green 'Cleaning build folders...'
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
Expand Down Expand Up @@ -143,7 +145,7 @@ if($NoDocs) {
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
}
$null = New-Item -ItemType Directory -Force -Path $docsFolder
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
$addComplexInterfaceInfo = !$isAzure
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
}

Expand Down Expand Up @@ -178,5 +180,4 @@ if (-not $DisableAfterBuildTasks){
}
}


Write-Host -ForegroundColor Green '-------------Done-------------'
Write-Host -ForegroundColor Green '-------------Done-------------'
4 changes: 2 additions & 2 deletions src/Migrate/Migrate.Autorest/custom/Get-AzMigrateJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The Get-AzMigrateJob cmdlet retrives the status of an Azure Migrate job.
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratejob
#>
function Get-AzMigrateJob {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IJob])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.IJob])]
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
param(
[Parameter(ParameterSetName = 'GetById', Mandatory)]
Expand Down Expand Up @@ -53,7 +53,7 @@ function Get-AzMigrateJob {

[Parameter(ParameterSetName = 'GetByInputObject', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IJob]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.IJob]
# Specifies the job object of the replicating server.
${InputObject},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The Get-AzMigrateServerReplication cmdlet retrieves the object for the replicati
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigrateserverreplication
#>
function Get-AzMigrateServerReplication {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IMigrationItem])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.IMigrationItem])]
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
param(
[Parameter(ParameterSetName = 'GetBySRSID', Mandatory)]
Expand Down Expand Up @@ -53,7 +53,7 @@ function Get-AzMigrateServerReplication {

[Parameter(ParameterSetName = 'GetByInputObject', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IMigrationItem]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.IMigrationItem]
# Specifies the machine object of the replicating server.
${InputObject},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ function Initialize-AzMigrateHCIReplicationInfrastructure {
}

if (-not $userObject) {
$userObject = Get-AzADServicePrincipal -ApplicationID $context.Account.Id
if ($context.Account.Id.StartsWith("MSI@")) {
$hostname = $env:COMPUTERNAME
$userObject = Get-AzADServicePrincipal -DisplayName $hostname
}
else {
$userObject = Get-AzADServicePrincipal -ApplicationID $context.Account.Id
}
}

if (-not $userObject) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ public static int hashForArtifact(String artifact)
$policyName = $MigratePrefix + $SiteName + "policy"
$existingPolicyObject = Get-AzMigrateReplicationPolicy -PolicyName $policyName -ResourceGroupName $ResourceGroupName -ResourceName $VaultName -ErrorVariable notPresent -ErrorAction SilentlyContinue
if (!$existingPolicyObject) {
$providerSpecificPolicy = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.VMwareCbtPolicyCreationInput]::new()
$providerSpecificPolicy = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.VMwareCbtPolicyCreationInput]::new()
$providerSpecificPolicy.AppConsistentFrequencyInMinute = 240
$providerSpecificPolicy.InstanceType = "VMwareCbt"
$providerSpecificPolicy.RecoveryPointHistoryInMinute = 360
Expand All @@ -566,7 +566,7 @@ public static int hashForArtifact(String artifact)
Write-Host $mappingName, " for ", $applianceName, $LogStringSkipping
}
else {
$providerSpecificInput = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.VMwareCbtContainerMappingInput]::new()
$providerSpecificInput = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.VMwareCbtContainerMappingInput]::new()
$providerSpecificInput.InstanceType = "VMwareCbt"
$providerSpecificInput.TargetLocation = $TargetRegion
if ([string]::IsNullOrEmpty($CacheStorageAccountId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The New-AzMigrateDiskMapping cmdlet creates a mapping of the source disk attache
https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratediskmapping
#>
function New-AzMigrateDiskMapping {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IVMwareCbtDiskInput])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.IVMwareCbtDiskInput])]
[CmdletBinding(DefaultParameterSetName = 'VMwareCbt', PositionalBinding = $false)]
param(
[Parameter(Mandatory)]
Expand Down Expand Up @@ -55,7 +55,7 @@ function New-AzMigrateDiskMapping {
)

process {
$DiskObject = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.VMwareCbtDiskInput]::new()
$DiskObject = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.VMwareCbtDiskInput]::new()
$DiskObject.DiskId = $DiskID

$validDiskTypeSpellings = @{
Expand Down
Loading