Update Azurestack Compute Admin module for managed disks - manual update
This commit is contained in:
Родитель
f76764afef
Коммит
a6f56c2313
|
@ -8,7 +8,7 @@ Locale: en-US
|
|||
|
||||
# Azs.Compute.Admin Module
|
||||
## Description
|
||||
Preview release of the AzureStack Compute administrator module which provides functionality to manage compute quotas, platform images, and virtual machine extensions
|
||||
Preview release of the AzureStack Compute administrator module which provides functionality to manage compute quotas, platform images, and virtual machine extensions, as well as managed disks migration jobs to rebalance storage.
|
||||
|
||||
## Azs.Compute.Admin Cmdlets
|
||||
### [Add-AzsPlatformImage](Add-AzsPlatformImage.md)
|
||||
|
@ -20,6 +20,12 @@ Create a new virtual machine extension image.
|
|||
### [Get-AzsComputeQuota](Get-AzsComputeQuota.md)
|
||||
Returns quotas specifying the quota limits for compute objects.
|
||||
|
||||
### [Get-AzsDisk](Get-AzsDisk.md)
|
||||
Returns the list of managed disks which can be migrated in the specified share.
|
||||
|
||||
### [Get-AzsDiskMigrationJob](Get-AzsDiskMigrationJob.md)
|
||||
Returns the list of managed disk migration jobs.
|
||||
|
||||
### [Get-AzsPlatformImage](Get-AzsPlatformImage.md)
|
||||
Returns virtual machine images loaded into the platform image repository.
|
||||
|
||||
|
@ -29,6 +35,9 @@ Returns virtual machine image extensions currently available.
|
|||
### [New-AzsComputeQuota](New-AzsComputeQuota.md)
|
||||
Create a new compute quota used to limit compute resources.
|
||||
|
||||
### [New-AzsDiskMigrationJob](New-AzsDiskMigrationJob.md)
|
||||
Starts a managed disk migration job to migrate managed disks to the specified destination share.
|
||||
|
||||
### [New-DataDiskObject](New-DataDiskObject.md)
|
||||
Creates a data disk which is used to create a new virtual machine platform image.
|
||||
|
||||
|
@ -44,3 +53,6 @@ Deletes a virtual machine extension image.
|
|||
### [Set-AzsComputeQuota](Set-AzsComputeQuota.md)
|
||||
Update an existing compute quota using the provided parameters.
|
||||
|
||||
### [Stop-AzsDiskMigrationJob](Stop-AzsDiskMigrationJob.md)
|
||||
Cancel a managed disk migration job.
|
||||
|
||||
|
|
|
@ -5,31 +5,27 @@ online version:
|
|||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-Disk
|
||||
# Get-AzsDisk
|
||||
|
||||
## SYNOPSIS
|
||||
Returns the list of managed disks which can be migrated in the specified share.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### Disks_List (Default)
|
||||
### List (Default)
|
||||
```
|
||||
Get-Disk -Location <String> [-Start <Int32>] [-SharePath <String>] [-Count <Int32>]
|
||||
Get-AzsDisk [-Location <String>] [-Start <Int32>] [-SharePath <String>] [-Count <Int32>]
|
||||
[-UserSubscriptionId <String>] [-Status <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### ResourceId_Disks_Get
|
||||
### ResourceId
|
||||
```
|
||||
Get-Disk -ResourceId <String> [<CommonParameters>]
|
||||
Get-AzsDisk -ResourceId <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### InputObject_Disks_Get
|
||||
### Get
|
||||
```
|
||||
Get-Disk -InputObject <Disk> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### Disks_Get
|
||||
```
|
||||
Get-Disk -Location <String> -Name <String> [<CommonParameters>]
|
||||
Get-AzsDisk [-Location <String>] -Name <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
@ -39,10 +35,17 @@ Returns a list of disks.
|
|||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> {{ Add example code here }}
|
||||
PS C:\> Get-AzsDisk -location local
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
Returns a list of managed disks at the location local. By default, it will the first 100 disks
|
||||
|
||||
### Example 2
|
||||
```
|
||||
Get-AzsDisk -location local -name $DiskId
|
||||
```
|
||||
|
||||
Get a specific managed disk.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
|
@ -51,7 +54,7 @@ The maximum number of disks to return.
|
|||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: Disks_List
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
|
@ -61,30 +64,15 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -InputObject
|
||||
The input object of type Microsoft.AzureStack.Management.Compute.Admin.Models.Disk.
|
||||
|
||||
```yaml
|
||||
Type: Disk
|
||||
Parameter Sets: InputObject_Disks_Get
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Location
|
||||
Location of the resource.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Disks_List, Disks_Get
|
||||
Parameter Sets: List, Get
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
|
@ -96,7 +84,7 @@ The disk guid as identity.
|
|||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Disks_Get
|
||||
Parameter Sets: Get
|
||||
Aliases: DiskId
|
||||
|
||||
Required: True
|
||||
|
@ -111,8 +99,8 @@ The resource id.
|
|||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: ResourceId_Disks_Get
|
||||
Aliases:
|
||||
Parameter Sets: ResourceId
|
||||
Aliases: Id
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
|
@ -126,7 +114,7 @@ The source share which the resource belongs to.
|
|||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Disks_List
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
|
@ -141,7 +129,7 @@ The start index of disks in query.
|
|||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: Disks_List
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
|
@ -156,7 +144,7 @@ The parameters of disk state.
|
|||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Disks_List
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
|
@ -171,7 +159,7 @@ Tenant Subscription Id which the resource belongs to.
|
|||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Disks_List
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
|
@ -5,30 +5,26 @@ online version:
|
|||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-DiskMigrationJob
|
||||
# Get-AzsDiskMigrationJob
|
||||
|
||||
## SYNOPSIS
|
||||
Returns the list of managed disk migration jobs.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### DiskMigrationJobs_List (Default)
|
||||
### List (Default)
|
||||
```
|
||||
Get-DiskMigrationJob [-Status <String>] -Location <String> [<CommonParameters>]
|
||||
Get-AzsDiskMigrationJob [-Status <String>] [-Location <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### ResourceId_DiskMigrationJobs_Get
|
||||
### ResourceId
|
||||
```
|
||||
Get-DiskMigrationJob -ResourceId <String> [<CommonParameters>]
|
||||
Get-AzsDiskMigrationJob -ResourceId <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### DiskMigrationJobs_Get
|
||||
### Get
|
||||
```
|
||||
Get-DiskMigrationJob -Location <String> -Name <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### InputObject_DiskMigrationJobs_Get
|
||||
```
|
||||
Get-DiskMigrationJob -InputObject <DiskMigrationJob> [<CommonParameters>]
|
||||
Get-AzsDiskMigrationJob [-Location <String>] -Name <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
@ -38,37 +34,29 @@ Returns a list of disk migration jobs.
|
|||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> {{ Add example code here }}
|
||||
PS C:\> Get-AzsDiskMigrationJob -location local
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
Returns a list of managed disk migration jobs at the location local.
|
||||
|
||||
### Example 2
|
||||
```
|
||||
Get-AzsDiskMigrationJob -location local -Name "mymigrationName"
|
||||
```
|
||||
|
||||
Get a specific managed disk migration job.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -InputObject
|
||||
The input object of type Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob.
|
||||
|
||||
```yaml
|
||||
Type: DiskMigrationJob
|
||||
Parameter Sets: InputObject_DiskMigrationJobs_Get
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Location
|
||||
Location of the resource.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: DiskMigrationJobs_List, DiskMigrationJobs_Get
|
||||
Parameter Sets: List, Get
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
|
@ -80,7 +68,7 @@ The migration job guid name.
|
|||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: DiskMigrationJobs_Get
|
||||
Parameter Sets: Get
|
||||
Aliases: MigrationId
|
||||
|
||||
Required: True
|
||||
|
@ -95,8 +83,8 @@ The resource id.
|
|||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: ResourceId_DiskMigrationJobs_Get
|
||||
Aliases:
|
||||
Parameter Sets: ResourceId
|
||||
Aliases: Id
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
|
@ -110,7 +98,7 @@ The parameters of disk migration job status.
|
|||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: DiskMigrationJobs_List
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
|
@ -0,0 +1,106 @@
|
|||
---
|
||||
external help file: Azs.Compute.Admin-help.xml
|
||||
Module Name: Azs.Compute.Admin
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-AzsDiskMigrationJob
|
||||
|
||||
## SYNOPSIS
|
||||
Starts a managed disk migration job to migrate managed disks to the specified destination share.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
New-AzsDiskMigrationJob [-Disks] <Disk[]> [-TargetShare] <String> [[-Location] <String>] [-Name] <String>
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Create a disk migration job.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> $disks = Get-AzsDisk -location local -Count 20
|
||||
PS C:\> New-AzsDiskMigrationJob -Name "MyMigrationJob" -Disks $disks -location local -TargetShare "\\SU1FileServer.azurestack.local\SU1_ObjStore"
|
||||
```
|
||||
|
||||
Start a managed disk migration job for the first 20 disks
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Disks
|
||||
The parameters of disk list.
|
||||
|
||||
```yaml
|
||||
Type: Disk[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Location
|
||||
Location of the resource.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
The migration job guid name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases: MigrationId
|
||||
|
||||
Required: True
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -TargetShare
|
||||
The target share name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
|
@ -1,150 +0,0 @@
|
|||
---
|
||||
external help file: Azs.Compute.Admin-help.xml
|
||||
Module Name: Azs.Compute.Admin
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-DiskMigrationJob
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### DiskMigrationJobs_Create (Default)
|
||||
```
|
||||
New-DiskMigrationJob
|
||||
-Disks <System.Collections.Generic.IList`1[Microsoft.AzureStack.Management.Compute.Admin.Models.Disk]>
|
||||
-TargetShare <String> -Location <String> -Name <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### ResourceId_DiskMigrationJobs_Create
|
||||
```
|
||||
New-DiskMigrationJob -ResourceId <String>
|
||||
-Disks <System.Collections.Generic.IList`1[Microsoft.AzureStack.Management.Compute.Admin.Models.Disk]>
|
||||
-TargetShare <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### InputObject_DiskMigrationJobs_Create
|
||||
```
|
||||
New-DiskMigrationJob
|
||||
-Disks <System.Collections.Generic.IList`1[Microsoft.AzureStack.Management.Compute.Admin.Models.Disk]>
|
||||
-TargetShare <String> -InputObject <DiskMigrationJob> [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Create a disk migration job.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Disks
|
||||
The parameters of disk list.
|
||||
|
||||
```yaml
|
||||
Type: System.Collections.Generic.IList`1[Microsoft.AzureStack.Management.Compute.Admin.Models.Disk]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -InputObject
|
||||
The input object of type Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob.
|
||||
|
||||
```yaml
|
||||
Type: DiskMigrationJob
|
||||
Parameter Sets: InputObject_DiskMigrationJobs_Create
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Location
|
||||
Location of the resource.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: DiskMigrationJobs_Create
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
The migration job guid name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: DiskMigrationJobs_Create
|
||||
Aliases: MigrationId
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResourceId
|
||||
The resource id.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: ResourceId_DiskMigrationJobs_Create
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByPropertyName)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -TargetShare
|
||||
The target share name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
|
@ -5,14 +5,15 @@ online version:
|
|||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Stop-DiskMigrationJob
|
||||
# Stop-AzsDiskMigrationJob
|
||||
|
||||
## SYNOPSIS
|
||||
Cancel a managed disk migration job.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Stop-DiskMigrationJob -Location <String> -MigrationId <String> [<CommonParameters>]
|
||||
Stop-AzsDiskMigrationJob [[-Location] <String>] [[-Name] <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
@ -22,10 +23,11 @@ Cancel a disk migration job.
|
|||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> {{ Add example code here }}
|
||||
PS C:\> $migration =New-AzsDiskMigrationJob -Name "mymigrationJob" -Disks $list -location local -TargetShare "\\SU1FileServer.azurestack.local\SU1_ObjStore"
|
||||
PS C:\> Stop-AzsDiskMigrationJob -Location local -Name $migration.MigrationId
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
Cancel a managed disk migration job.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
|
@ -37,23 +39,23 @@ Type: String
|
|||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -MigrationId
|
||||
The migration job guid name.
|
||||
### -Name
|
||||
{{Fill Name Description}}
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Aliases: MigrationId
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
|
@ -40,8 +40,8 @@
|
|||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AzureStack.Management.Admin.Compute, Version=0.1.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Compute.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Compute.Admin.dll</HintPath>
|
||||
<Reference Include="Microsoft.AzureStack.Management.Admin.Compute, Version=0.3.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Compute.Admin.0.3.0-preview\lib\net452\Microsoft.AzureStack.Management.Compute.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -80,7 +80,9 @@ Licensed under the MIT License. See License.txt in the project root for license
|
|||
'Remove-AzsVMExtension',
|
||||
'Get-AzsPlatformImage', 'Get-AzsComputeQuota',
|
||||
'Add-AzsVMExtension', 'Set-AzsComputeQuota',
|
||||
'Remove-AzsPlatformImage', 'New-DataDiskObject'
|
||||
'Remove-AzsPlatformImage', 'New-DataDiskObject',
|
||||
'Get-AzsDisk','Get-AzsDiskMigrationJob',
|
||||
'New-AzsDiskMigrationJob', 'Stop-AzsDiskMigrationJob'
|
||||
|
||||
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
|
||||
CmdletsToExport = @()
|
||||
|
@ -89,7 +91,7 @@ Licensed under the MIT License. See License.txt in the project root for license
|
|||
# VariablesToExport = @()
|
||||
|
||||
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
|
||||
AliasesToExport = @()
|
||||
AliasesToExport = @('Start-AzsDiskMigrationJob')
|
||||
|
||||
# DSC resources to export from this module
|
||||
# DscResourcesToExport = @()
|
||||
|
|
|
@ -0,0 +1,188 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
Code generated by Microsoft (R) PSSwagger
|
||||
Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Returns the list of managed disks which can be migrated in the specified share.
|
||||
|
||||
.DESCRIPTION
|
||||
Returns a list of disks.
|
||||
|
||||
.PARAMETER ResourceId
|
||||
The resource id.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Start
|
||||
The start index of disks in query.
|
||||
|
||||
.PARAMETER SharePath
|
||||
The source share which the resource belongs to.
|
||||
|
||||
.PARAMETER Count
|
||||
The maximum number of disks to return.
|
||||
|
||||
.PARAMETER UserSubscriptionId
|
||||
Tenant Subscription Id which the resource belongs to.
|
||||
|
||||
.PARAMETER Status
|
||||
The parameters of disk state.
|
||||
|
||||
.PARAMETER Name
|
||||
The disk guid as identity.
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
PS C:\> $disks = Get-AzsDisk -location local
|
||||
PS C:\> $disk = Get-AzsDisk -location local -name $DiskId
|
||||
#>
|
||||
function Get-AzsDisk
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.Disk])]
|
||||
[CmdletBinding(DefaultParameterSetName='List')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ResourceId')]
|
||||
[System.String]
|
||||
[Alias('Id')]
|
||||
$ResourceId,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'Get')]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.Nullable`1[System.Int32]]
|
||||
$Start = $null,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$SharePath,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.Nullable`1[System.Int32]]
|
||||
$Count = $null,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$UserSubscriptionId,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$Status,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'Get')]
|
||||
[Alias('DiskId')]
|
||||
[System.String]
|
||||
$Name
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
$DiskId = $Name
|
||||
|
||||
|
||||
if('ResourceId' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params = @{
|
||||
IdTemplate = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute.Admin/locations/{location}/disks/{DiskId}'
|
||||
}
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $ResourceId
|
||||
|
||||
$ArmResourceIdParameterValues = Get-ArmResourceIdParameterValue @GetArmResourceIdParameterValue_params
|
||||
$location = $ArmResourceIdParameterValues['location']
|
||||
|
||||
$DiskId = $ArmResourceIdParameterValues['DiskId']
|
||||
}elseif (-not $PSBoundParameters.ContainsKey('Location')) {
|
||||
$Location = (Get-AzureRMLocation).Location
|
||||
}
|
||||
|
||||
$filterInfos = @(
|
||||
@{
|
||||
'Type' = 'powershellWildcard'
|
||||
'Value' = $DiskId
|
||||
'Property' = 'Name'
|
||||
})
|
||||
$applicableFilters = Get-ApplicableFilters -Filters $filterInfos
|
||||
if ($applicableFilters | Where-Object { $_.Strict }) {
|
||||
Write-Verbose -Message 'Performing server-side call ''Get-AzsDisk -'''
|
||||
$serverSideCall_params = @{
|
||||
|
||||
}
|
||||
|
||||
$serverSideResults = Get-AzsDisk @serverSideCall_params
|
||||
foreach ($serverSideResult in $serverSideResults) {
|
||||
$valid = $true
|
||||
foreach ($applicableFilter in $applicableFilters) {
|
||||
if (-not (Test-FilteredResult -Result $serverSideResult -Filter $applicableFilter.Filter)) {
|
||||
$valid = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if ($valid) {
|
||||
$serverSideResult
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
if ('List' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation ListWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.Disks.ListWithHttpMessagesAsync($Location, $(if ($PSBoundParameters.ContainsKey('UserSubscriptionId')) { $UserSubscriptionId } else { [NullString]::Value }), $(if ($PSBoundParameters.ContainsKey('Status')) { $Status } else { [NullString]::Value }), $(if ($PSBoundParameters.ContainsKey('SharePath')) { $SharePath } else { [NullString]::Value }), $Count, $Start)
|
||||
} elseif ('Get' -eq $PsCmdlet.ParameterSetName -or 'ResourceId' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation GetWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.Disks.GetWithHttpMessagesAsync($Location, $DiskId)
|
||||
} else {
|
||||
Write-Verbose -Message 'Failed to map parameter set to operation method.'
|
||||
throw 'Module failed to find operation to execute.'
|
||||
}
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
Code generated by Microsoft (R) PSSwagger
|
||||
Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Returns the list of managed disk migration jobs.
|
||||
|
||||
.DESCRIPTION
|
||||
Returns a list of disk migration jobs.
|
||||
|
||||
.PARAMETER ResourceId
|
||||
The resource id.
|
||||
|
||||
.PARAMETER Status
|
||||
The parameters of disk migration job status.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Name
|
||||
The migration job guid name.
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
PS C:\> $migrations = Get-AzsDiskMigrationJob -location local
|
||||
PS C:\> $migration = Get-AzsDiskMigrationJob -location local -Name "mymigrationName"
|
||||
#>
|
||||
function Get-AzsDiskMigrationJob
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob])]
|
||||
[CmdletBinding(DefaultParameterSetName='List')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ResourceId')]
|
||||
[System.String]
|
||||
[Alias('Id')]
|
||||
$ResourceId,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$Status,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'Get')]
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'Get')]
|
||||
[Alias('MigrationId')]
|
||||
[System.String]
|
||||
$Name
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
$MigrationId = $Name
|
||||
|
||||
|
||||
if('ResourceId' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params = @{
|
||||
IdTemplate = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute.Admin/locations/{location}/diskmigrationjobs/{migrationId}'
|
||||
}
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $ResourceId
|
||||
|
||||
$ArmResourceIdParameterValues = Get-ArmResourceIdParameterValue @GetArmResourceIdParameterValue_params
|
||||
$location = $ArmResourceIdParameterValues['location']
|
||||
|
||||
$migrationId = $ArmResourceIdParameterValues['migrationId']
|
||||
}elseif (-not $PSBoundParameters.ContainsKey('Location')) {
|
||||
$Location = (Get-AzureRMLocation).Location
|
||||
}
|
||||
|
||||
$filterInfos = @(
|
||||
@{
|
||||
'Type' = 'powershellWildcard'
|
||||
'Value' = $MigrationId
|
||||
'Property' = 'Name'
|
||||
})
|
||||
$applicableFilters = Get-ApplicableFilters -Filters $filterInfos
|
||||
if ($applicableFilters | Where-Object { $_.Strict }) {
|
||||
Write-Verbose -Message 'Performing server-side call ''Get-AzsDiskMigrationJob -'''
|
||||
$serverSideCall_params = @{
|
||||
|
||||
}
|
||||
|
||||
$serverSideResults = Get-AzsDiskMigrationJob @serverSideCall_params
|
||||
foreach ($serverSideResult in $serverSideResults) {
|
||||
$valid = $true
|
||||
foreach ($applicableFilter in $applicableFilters) {
|
||||
if (-not (Test-FilteredResult -Result $serverSideResult -Filter $applicableFilter.Filter)) {
|
||||
$valid = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if ($valid) {
|
||||
$serverSideResult
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
if ('List' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation ListWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.ListWithHttpMessagesAsync($Location, $(if ($PSBoundParameters.ContainsKey('Status')) { $Status } else { [NullString]::Value }))
|
||||
} elseif ('Get' -eq $PsCmdlet.ParameterSetName -or 'ResourceId' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation GetWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.GetWithHttpMessagesAsync($Location, $MigrationId)
|
||||
} else {
|
||||
Write-Verbose -Message 'Failed to map parameter set to operation method.'
|
||||
throw 'Module failed to find operation to execute.'
|
||||
}
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,192 +0,0 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
|
||||
.DESCRIPTION
|
||||
Returns a list of disks.
|
||||
|
||||
.PARAMETER ResourceId
|
||||
The resource id.
|
||||
|
||||
.PARAMETER InputObject
|
||||
The input object of type Microsoft.AzureStack.Management.Compute.Admin.Models.Disk.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Start
|
||||
The start index of disks in query.
|
||||
|
||||
.PARAMETER SharePath
|
||||
The source share which the resource belongs to.
|
||||
|
||||
.PARAMETER Count
|
||||
The maximum number of disks to return.
|
||||
|
||||
.PARAMETER UserSubscriptionId
|
||||
Tenant Subscription Id which the resource belongs to.
|
||||
|
||||
.PARAMETER Status
|
||||
The parameters of disk state.
|
||||
|
||||
.PARAMETER Name
|
||||
The disk guid as identity.
|
||||
|
||||
#>
|
||||
function Get-Disk
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.Disk])]
|
||||
[CmdletBinding(DefaultParameterSetName='Disks_List')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ResourceId_Disks_Get')]
|
||||
[System.String]
|
||||
$ResourceId,
|
||||
|
||||
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'InputObject_Disks_Get')]
|
||||
[Microsoft.AzureStack.Management.Compute.Admin.Models.Disk]
|
||||
$InputObject,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'Disks_List')]
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'Disks_Get')]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'Disks_List')]
|
||||
[System.Nullable`1[System.Int32]]
|
||||
$Start = $null,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'Disks_List')]
|
||||
[System.String]
|
||||
$SharePath,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'Disks_List')]
|
||||
[System.Nullable`1[System.Int32]]
|
||||
$Count = $null,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'Disks_List')]
|
||||
[System.String]
|
||||
$UserSubscriptionId,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'Disks_List')]
|
||||
[System.String]
|
||||
$Status,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'Disks_Get')]
|
||||
[Alias('DiskId')]
|
||||
[System.String]
|
||||
$Name
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
$DiskId = $Name
|
||||
|
||||
|
||||
if('InputObject_Disks_Get' -eq $PsCmdlet.ParameterSetName -or 'ResourceId_Disks_Get' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params = @{
|
||||
IdTemplate = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute.Admin/locations/{location}/disks/{DiskId}'
|
||||
}
|
||||
|
||||
if('ResourceId_Disks_Get' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $ResourceId
|
||||
}
|
||||
else {
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $InputObject.Id
|
||||
}
|
||||
$ArmResourceIdParameterValues = Get-ArmResourceIdParameterValue @GetArmResourceIdParameterValue_params
|
||||
$location = $ArmResourceIdParameterValues['location']
|
||||
|
||||
$DiskId = $ArmResourceIdParameterValues['DiskId']
|
||||
}
|
||||
|
||||
$filterInfos = @(
|
||||
@{
|
||||
'Type' = 'powershellWildcard'
|
||||
'Value' = $DiskId
|
||||
'Property' = 'Name'
|
||||
})
|
||||
$applicableFilters = Get-ApplicableFilters -Filters $filterInfos
|
||||
if ($applicableFilters | Where-Object { $_.Strict }) {
|
||||
Write-Verbose -Message 'Performing server-side call ''Get-Disk -'''
|
||||
$serverSideCall_params = @{
|
||||
|
||||
}
|
||||
|
||||
$serverSideResults = Get-Disk @serverSideCall_params
|
||||
foreach ($serverSideResult in $serverSideResults) {
|
||||
$valid = $true
|
||||
foreach ($applicableFilter in $applicableFilters) {
|
||||
if (-not (Test-FilteredResult -Result $serverSideResult -Filter $applicableFilter.Filter)) {
|
||||
$valid = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if ($valid) {
|
||||
$serverSideResult
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
if ('Disks_List' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation ListWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.Disks.ListWithHttpMessagesAsync($Location, $(if ($PSBoundParameters.ContainsKey('UserSubscriptionId')) { $UserSubscriptionId } else { [NullString]::Value }), $(if ($PSBoundParameters.ContainsKey('Status')) { $Status } else { [NullString]::Value }), $(if ($PSBoundParameters.ContainsKey('SharePath')) { $SharePath } else { [NullString]::Value }), $Count, $Start)
|
||||
} elseif ('Disks_Get' -eq $PsCmdlet.ParameterSetName -or 'InputObject_Disks_Get' -eq $PsCmdlet.ParameterSetName -or 'ResourceId_Disks_Get' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation GetWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.Disks.GetWithHttpMessagesAsync($Location, $DiskId)
|
||||
} else {
|
||||
Write-Verbose -Message 'Failed to map parameter set to operation method.'
|
||||
throw 'Module failed to find operation to execute.'
|
||||
}
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
|
||||
.DESCRIPTION
|
||||
Returns a list of disk migration jobs.
|
||||
|
||||
.PARAMETER ResourceId
|
||||
The resource id.
|
||||
|
||||
.PARAMETER Status
|
||||
The parameters of disk migration job status.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Name
|
||||
The migration job guid name.
|
||||
|
||||
.PARAMETER InputObject
|
||||
The input object of type Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob.
|
||||
|
||||
#>
|
||||
function Get-DiskMigrationJob
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob])]
|
||||
[CmdletBinding(DefaultParameterSetName='DiskMigrationJobs_List')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ResourceId_DiskMigrationJobs_Get')]
|
||||
[System.String]
|
||||
$ResourceId,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'DiskMigrationJobs_List')]
|
||||
[System.String]
|
||||
$Status,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'DiskMigrationJobs_Get')]
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'DiskMigrationJobs_List')]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'DiskMigrationJobs_Get')]
|
||||
[Alias('MigrationId')]
|
||||
[System.String]
|
||||
$Name,
|
||||
|
||||
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'InputObject_DiskMigrationJobs_Get')]
|
||||
[Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob]
|
||||
$InputObject
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
$MigrationId = $Name
|
||||
|
||||
|
||||
if('InputObject_DiskMigrationJobs_Get' -eq $PsCmdlet.ParameterSetName -or 'ResourceId_DiskMigrationJobs_Get' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params = @{
|
||||
IdTemplate = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute.Admin/locations/{location}/diskmigrationjobs/{migrationId}'
|
||||
}
|
||||
|
||||
if('ResourceId_DiskMigrationJobs_Get' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $ResourceId
|
||||
}
|
||||
else {
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $InputObject.Id
|
||||
}
|
||||
$ArmResourceIdParameterValues = Get-ArmResourceIdParameterValue @GetArmResourceIdParameterValue_params
|
||||
$location = $ArmResourceIdParameterValues['location']
|
||||
|
||||
$migrationId = $ArmResourceIdParameterValues['migrationId']
|
||||
}
|
||||
|
||||
$filterInfos = @(
|
||||
@{
|
||||
'Type' = 'powershellWildcard'
|
||||
'Value' = $MigrationId
|
||||
'Property' = 'Name'
|
||||
})
|
||||
$applicableFilters = Get-ApplicableFilters -Filters $filterInfos
|
||||
if ($applicableFilters | Where-Object { $_.Strict }) {
|
||||
Write-Verbose -Message 'Performing server-side call ''Get-DiskMigrationJob -'''
|
||||
$serverSideCall_params = @{
|
||||
|
||||
}
|
||||
|
||||
$serverSideResults = Get-DiskMigrationJob @serverSideCall_params
|
||||
foreach ($serverSideResult in $serverSideResults) {
|
||||
$valid = $true
|
||||
foreach ($applicableFilter in $applicableFilters) {
|
||||
if (-not (Test-FilteredResult -Result $serverSideResult -Filter $applicableFilter.Filter)) {
|
||||
$valid = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if ($valid) {
|
||||
$serverSideResult
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
if ('DiskMigrationJobs_List' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation ListWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.ListWithHttpMessagesAsync($Location, $(if ($PSBoundParameters.ContainsKey('Status')) { $Status } else { [NullString]::Value }))
|
||||
} elseif ('DiskMigrationJobs_Get' -eq $PsCmdlet.ParameterSetName -or 'InputObject_DiskMigrationJobs_Get' -eq $PsCmdlet.ParameterSetName -or 'ResourceId_DiskMigrationJobs_Get' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation GetWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.GetWithHttpMessagesAsync($Location, $MigrationId)
|
||||
} else {
|
||||
Write-Verbose -Message 'Failed to map parameter set to operation method.'
|
||||
throw 'Module failed to find operation to execute.'
|
||||
}
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
Code generated by Microsoft (R) PSSwagger
|
||||
Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Starts a managed disk migration job to migrate managed disks to the specified destination share.
|
||||
|
||||
.DESCRIPTION
|
||||
Create a disk migration job.
|
||||
|
||||
.PARAMETER ResourceId
|
||||
The resource id.
|
||||
|
||||
.PARAMETER Disks
|
||||
The parameters of disk list.
|
||||
|
||||
.PARAMETER TargetShare
|
||||
The target share name.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Name
|
||||
The migration job guid name.
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
PS C:\> $disks = Get-AzsDisk -location local
|
||||
PS C:\> New-AzsDiskMigrationJob -Name "MyMigrationJob" -Disks $disks -location local -TargetShare "\\SU1FileServer.azurestack.local\SU1_ObjStore"
|
||||
#>
|
||||
function New-AzsDiskMigrationJob
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob])]
|
||||
[Alias('Start-AzsDiskMigrationJob')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[Microsoft.AzureStack.Management.Compute.Admin.Models.Disk[]]
|
||||
$Disks,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[System.String]
|
||||
$TargetShare,
|
||||
|
||||
[Parameter(Mandatory = $false)]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[Alias('MigrationId')]
|
||||
[System.String]
|
||||
$Name
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
$MigrationId = $Name
|
||||
|
||||
|
||||
if (-not $PSBoundParameters.ContainsKey('Location')) {
|
||||
$Location = (Get-AzureRMLocation).Location
|
||||
}
|
||||
|
||||
Write-Verbose -Message 'Performing operation CreateWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.CreateWithHttpMessagesAsync($Location, $MigrationId, $TargetShare, $Disks)
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
|
||||
.DESCRIPTION
|
||||
Create a disk migration job.
|
||||
|
||||
.PARAMETER ResourceId
|
||||
The resource id.
|
||||
|
||||
.PARAMETER Disks
|
||||
The parameters of disk list.
|
||||
|
||||
.PARAMETER TargetShare
|
||||
The target share name.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Name
|
||||
The migration job guid name.
|
||||
|
||||
.PARAMETER InputObject
|
||||
The input object of type Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob.
|
||||
|
||||
#>
|
||||
function New-DiskMigrationJob
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob])]
|
||||
[CmdletBinding(DefaultParameterSetName='DiskMigrationJobs_Create')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ResourceId_DiskMigrationJobs_Create')]
|
||||
[System.String]
|
||||
$ResourceId,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'DiskMigrationJobs_Create')]
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'InputObject_DiskMigrationJobs_Create')]
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'ResourceId_DiskMigrationJobs_Create')]
|
||||
[System.Collections.Generic.IList`1[Microsoft.AzureStack.Management.Compute.Admin.Models.Disk]]
|
||||
$Disks,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'DiskMigrationJobs_Create')]
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'InputObject_DiskMigrationJobs_Create')]
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'ResourceId_DiskMigrationJobs_Create')]
|
||||
[System.String]
|
||||
$TargetShare,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'DiskMigrationJobs_Create')]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'DiskMigrationJobs_Create')]
|
||||
[Alias('MigrationId')]
|
||||
[System.String]
|
||||
$Name,
|
||||
|
||||
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'InputObject_DiskMigrationJobs_Create')]
|
||||
[Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob]
|
||||
$InputObject
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
$MigrationId = $Name
|
||||
|
||||
|
||||
if('InputObject_DiskMigrationJobs_Create' -eq $PsCmdlet.ParameterSetName -or 'ResourceId_DiskMigrationJobs_Create' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params = @{
|
||||
IdTemplate = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute.Admin/locations/{location}/diskmigrationjobs/{migrationId}'
|
||||
}
|
||||
|
||||
if('ResourceId_DiskMigrationJobs_Create' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $ResourceId
|
||||
}
|
||||
else {
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $InputObject.Id
|
||||
}
|
||||
$ArmResourceIdParameterValues = Get-ArmResourceIdParameterValue @GetArmResourceIdParameterValue_params
|
||||
$location = $ArmResourceIdParameterValues['location']
|
||||
|
||||
$migrationId = $ArmResourceIdParameterValues['migrationId']
|
||||
}
|
||||
|
||||
|
||||
if ('DiskMigrationJobs_Create' -eq $PsCmdlet.ParameterSetName -or 'InputObject_DiskMigrationJobs_Create' -eq $PsCmdlet.ParameterSetName -or 'ResourceId_DiskMigrationJobs_Create' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation CreateWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.CreateWithHttpMessagesAsync($Location, $MigrationId, $TargetShare, $Disks)
|
||||
} else {
|
||||
Write-Verbose -Message 'Failed to map parameter set to operation method.'
|
||||
throw 'Module failed to find operation to execute.'
|
||||
}
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
Code generated by Microsoft (R) PSSwagger
|
||||
Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Cancel a managed disk migration job.
|
||||
|
||||
.DESCRIPTION
|
||||
Cancel a disk migration job.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER MigrationId
|
||||
The migration job guid name.
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
PS C:\> $migration =New-AzsDiskMigrationJob -Name "mymigrationJob" -Disks $list -location local -TargetShare "\\SU1FileServer.azurestack.local\SU1_ObjStore"
|
||||
PS C:\> Stop-AzsDiskMigrationJob -Location local -MigrationId $migration.MigrationId
|
||||
|
||||
#>
|
||||
function Stop-AzsDiskMigrationJob
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob])]
|
||||
param(
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Alias('MigrationId')]
|
||||
[System.String]
|
||||
$Name
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
if (-not $PSBoundParameters.ContainsKey('Location')) {
|
||||
$Location = (Get-AzureRMLocation).Location
|
||||
}
|
||||
|
||||
Write-Verbose -Message 'Performing operation CancelWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.CancelWithHttpMessagesAsync($Location, $Name)
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
|
||||
.DESCRIPTION
|
||||
Cancel a disk migration job.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER MigrationId
|
||||
The migration job guid name.
|
||||
|
||||
#>
|
||||
function Stop-DiskMigrationJob
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob])]
|
||||
[CmdletBinding(DefaultParameterSetName='DiskMigrationJobs_Cancel')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'DiskMigrationJobs_Cancel')]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'DiskMigrationJobs_Cancel')]
|
||||
[System.String]
|
||||
$MigrationId
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
|
||||
if ('DiskMigrationJobs_Cancel' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation CancelWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.CancelWithHttpMessagesAsync($Location, $MigrationId)
|
||||
} else {
|
||||
Write-Verbose -Message 'Failed to map parameter set to operation method.'
|
||||
throw 'Module failed to find operation to execute.'
|
||||
}
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.AzureStack.Management.Compute.Admin" version="0.1.0-preview" targetFramework="net45" />
|
||||
<package id="Microsoft.AzureStack.Management.Compute.Admin" version="0.3.0-preview" targetFramework="net45" />
|
||||
</packages>
|
|
@ -40,8 +40,8 @@
|
|||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AzureStack.Management.Compute.Admin, Version=0.1.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Compute.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Compute.Admin.dll</HintPath>
|
||||
<Reference Include="Microsoft.AzureStack.Management.Compute.Admin, Version=0.3.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Compute.Admin.0.3.0-preview\lib\net452\Microsoft.AzureStack.Management.Compute.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,355 @@
|
|||
{
|
||||
"Entries": [
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/disks?api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza3M/YXBpLXZlcnNpb249MjAxOC0wNy0zMC1wcmV2aWV3",
|
||||
"RequestMethod": "GET",
|
||||
"RequestBody": "",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"805db210-5d5e-49fc-9d59-e8f84a47c6dc"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:22 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvxJ7lxO+6/+ugzZtTW9JWA8SLaHAn4R/Mt3cSesxpwbnpgwjiS7bV0scTtd5a113ri4sI8nf81CeA3No0fJPFsw+kBjqswGo+oVcak8/1/pjMInRvgpXCv6k95Ga8l3vMLjjvnpA7h1Z5muyk6GPI"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"63edde96-9353-4e87-bd2e-38069a11b332"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-reads": [
|
||||
"14979"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"63edde96-9353-4e87-bd2e-38069a11b332"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082522Z:63edde96-9353-4e87-bd2e-38069a11b332"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"813"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/disks/2811b3ba-dc71-4a96-8c99-b300a35f46e8\",\r\n \"name\": \"local/2811b3ba-dc71-4a96-8c99-b300a35f46e8\",\r\n \"type\": \"Microsoft.Compute.Admin/locations/disks\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"diskId\": \"2811b3ba-dc71-4a96-8c99-b300a35f46e8\",\r\n \"status\": \"Unattached\",\r\n \"sharePath\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"actualSizeGB\": 1,\r\n \"provisionSizeGB\": 4,\r\n \"userResourceId\": \"/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/resourceGroups/SYSTEM/providers/Microsoft.Compute/Disks/testdisk\",\r\n \"diskType\": \"Disk\",\r\n \"diskSku\": \"Standard_LRS\"\r\n }\r\n }\r\n ]\r\n}",
|
||||
"StatusCode": 200
|
||||
},
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2?targetShare=%5C%5CSU1FileServer.azurestack.local%5CSU1_ObjStore_Invalid%5C&api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza21pZ3JhdGlvbmpvYnMvQTUwRTlFNkItQ0ZDMi00QkM3LTk1NkItMEY3QzM1MDM1REYyP3RhcmdldFNoYXJlPSU1QyU1Q1NVMUZpbGVTZXJ2ZXIuYXp1cmVzdGFjay5sb2NhbCU1Q1NVMV9PYmpTdG9yZV9JbnZhbGlkJTVDJmFwaS12ZXJzaW9uPTIwMTgtMDctMzAtcHJldmlldw==",
|
||||
"RequestMethod": "PUT",
|
||||
"RequestBody": "[\r\n {\r\n \"properties\": {\r\n \"diskId\": \"2811b3ba-dc71-4a96-8c99-b300a35f46e8\",\r\n \"status\": \"Unattached\",\r\n \"sharePath\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\"\r\n },\r\n \"location\": \"local\"\r\n }\r\n]",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"1e18d2b9-8e7c-4d57-a8ae-f856e91e4f9d"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Content-Length": [
|
||||
"227"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:22 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvQ8nnMqu9QJBgAGniGT9cEuFfAXGX7CP1qFkO1nlFTmF/SSUkYfmJvdv/FEMT8GHlHlq56Wbw8zs4FvDGCq6NFPxU39kudJ/rE3o4W15PGcWqGlO+VVOomCeGZ1Xc9YeNZwBZfCbx6XFKUivoBSIG"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"eb709fd9-84ac-4f2c-a21a-3341aac62346"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-writes": [
|
||||
"1195"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"eb709fd9-84ac-4f2c-a21a-3341aac62346"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082523Z:eb709fd9-84ac-4f2c-a21a-3341aac62346"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"150"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"BadRequest\",\r\n \"message\": \"Share path \\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore_Invalid is not found.\"\r\n }\r\n}",
|
||||
"StatusCode": 400
|
||||
},
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2?api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza21pZ3JhdGlvbmpvYnMvQTUwRTlFNkItQ0ZDMi00QkM3LTk1NkItMEY3QzM1MDM1REYyP2FwaS12ZXJzaW9uPTIwMTgtMDctMzAtcHJldmlldw==",
|
||||
"RequestMethod": "GET",
|
||||
"RequestBody": "",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"99753c04-c43f-4873-87e0-42e55cec1783"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:28 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvlzU+nqCmAdc8wnezD4pEQtH2YsCmqGkyDNx0c9I7EAkVVV/fa0ITqGuZ8VueUqmYI9a74useEzJvOXfTTNnG7QHigWiFK6gSUS6qUaUwB4nJCI9gknfZuBaNfu/9PJa/6MeBS95rmdE8NxkTKugd"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"b41e431b-8871-479b-8807-41c0949c2238"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-reads": [
|
||||
"14978"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"b41e431b-8871-479b-8807-41c0949c2238"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082528Z:b41e431b-8871-479b-8807-41c0949c2238"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"92"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": \"The entity was not found.\"\r\n }\r\n}",
|
||||
"StatusCode": 404
|
||||
},
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2?api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza21pZ3JhdGlvbmpvYnMvQTUwRTlFNkItQ0ZDMi00QkM3LTk1NkItMEY3QzM1MDM1REYyP2FwaS12ZXJzaW9uPTIwMTgtMDctMzAtcHJldmlldw==",
|
||||
"RequestMethod": "GET",
|
||||
"RequestBody": "",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"0f0872fd-d184-4e0e-9183-c57e338e6c25"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:33 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvnY22FDLaSr6nXG6OuBxaq3x8JqbJnTUdv//mCK1raNO5xkS8j4Xu/u7fuzt+KzDcXAyb2xg4ZIzCvPKUZkcQFiVV1/DhG2JaEizFe2JyXKsiAEEpowABcTmmxsmiwigEBSsUwY39mNa1bOekdGyS"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"8aebb728-305f-4444-a09a-7c28ee1692f5"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-reads": [
|
||||
"14977"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"8aebb728-305f-4444-a09a-7c28ee1692f5"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082533Z:8aebb728-305f-4444-a09a-7c28ee1692f5"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"1209"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"id\": \"/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"name\": \"local/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"type\": \"Microsoft.Compute.Admin/locations/diskmigrationjobs\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"migrationId\": \"A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"status\": \"Running\",\r\n \"subtasks\": [\r\n {\r\n \"migrationSubTaskId\": \"3c049aca-b16c-4938-90ef-8d623e508fc1\",\r\n \"properties\": {\r\n \"migrationSubtaskStatus\": \"Skipped\",\r\n \"reason\": \"Disk 454e5e28-8d5e-41f9-929e-bff6a7e1a253 not found.\",\r\n \"startTime\": \"2018-08-09T08:25:30.6667894Z\",\r\n \"targetShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"sourceShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"targetDiskStateForMigration\": \"Unattached\",\r\n \"diskId\": \"454e5e28-8d5e-41f9-929e-bff6a7e1a253\"\r\n }\r\n }\r\n ],\r\n \"creationTime\": \"2018-08-09T08:25:30.6667894Z\",\r\n \"startTime\": \"2018-08-09T08:25:30.6667894Z\",\r\n \"targetShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\"\r\n }\r\n}",
|
||||
"StatusCode": 200
|
||||
},
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2?targetShare=%5C%5CSU1FileServer.azurestack.local%5CSU1_ObjStore%5C&api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza21pZ3JhdGlvbmpvYnMvQTUwRTlFNkItQ0ZDMi00QkM3LTk1NkItMEY3QzM1MDM1REYyP3RhcmdldFNoYXJlPSU1QyU1Q1NVMUZpbGVTZXJ2ZXIuYXp1cmVzdGFjay5sb2NhbCU1Q1NVMV9PYmpTdG9yZSU1QyZhcGktdmVyc2lvbj0yMDE4LTA3LTMwLXByZXZpZXc=",
|
||||
"RequestMethod": "PUT",
|
||||
"RequestBody": "[\r\n {\r\n \"properties\": {\r\n \"diskId\": \"454E5E28-8D5E-41F9-929E-BFF6A7E1A253\",\r\n \"status\": \"Unattached\",\r\n \"sharePath\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\"\r\n },\r\n \"location\": \"local\"\r\n }\r\n]",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"1738df09-9138-4101-9f94-959f35a6cbeb"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Content-Length": [
|
||||
"227"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:30 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvU+xULFYWzMcZiEbccHJF8QK01573XIeoXAJ6e2v85SNHFrE+8fb9OE2KxJ5LxEVUxfk80JTXyDmvRYcMjUTe/SIUuU+zYLrMahnn/pxBTpk/qRgpNY3GPHoQ8CMwnGdp9Iee0MdDKTnBnk8j53IU"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"6b9dd42a-3696-4c33-88d0-08bf8ac597e7"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-writes": [
|
||||
"1194"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"6b9dd42a-3696-4c33-88d0-08bf8ac597e7"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082530Z:6b9dd42a-3696-4c33-88d0-08bf8ac597e7"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"1026"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"id\": \"/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"name\": \"local/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"type\": \"Microsoft.Compute.Admin/locations/diskmigrationjobs\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"migrationId\": \"A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"status\": \"Pending\",\r\n \"subtasks\": [\r\n {\r\n \"migrationSubTaskId\": \"3c049aca-b16c-4938-90ef-8d623e508fc1\",\r\n \"properties\": {\r\n \"migrationSubtaskStatus\": \"Pending\",\r\n \"targetShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"sourceShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"targetDiskStateForMigration\": \"Unattached\",\r\n \"diskId\": \"454e5e28-8d5e-41f9-929e-bff6a7e1a253\"\r\n }\r\n }\r\n ],\r\n \"creationTime\": \"2018-08-09T08:25:30.6667894Z\",\r\n \"targetShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\"\r\n }\r\n}",
|
||||
"StatusCode": 200
|
||||
}
|
||||
],
|
||||
"Names": {},
|
||||
"Variables": {
|
||||
"SubscriptionId": "c69f350f-01b9-417d-bb90-08a397934964"
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"Entries": [
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/disks/454E5E28-8D5E-41F9-929E-BFF6A7E1A253?api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza3MvNDU0RTVFMjgtOEQ1RS00MUY5LTkyOUUtQkZGNkE3RTFBMjUzP2FwaS12ZXJzaW9uPTIwMTgtMDctMzAtcHJldmlldw==",
|
||||
"RequestMethod": "GET",
|
||||
"RequestBody": "",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"4e863a57-76fb-452d-88a0-0f02536482c4"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 06:05:35 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvjIutUf86si1PznOxO46jZQoJpHzmbKpfCyvgxna+bM0QZeMSLg3+oXjDYvFcH4XZZO7xel4mEqfwVL014pnxwvP4Wbw7Y76vkIsHL5yXg+zw12stsD3/bGcayVkZVHeb1psmHvCI7swotWiODA3x"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"cbe90dad-de09-4f3d-8266-9c494514767e"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-reads": [
|
||||
"14972"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"cbe90dad-de09-4f3d-8266-9c494514767e"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T060536Z:cbe90dad-de09-4f3d-8266-9c494514767e"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"92"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": \"The entity was not found.\"\r\n }\r\n}",
|
||||
"StatusCode": 404
|
||||
}
|
||||
],
|
||||
"Names": {},
|
||||
"Variables": {
|
||||
"SubscriptionId": "c69f350f-01b9-417d-bb90-08a397934964"
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -64,12 +64,13 @@ InModuleScope Azs.Compute.Admin {
|
|||
$Disk.Id | Should Not Be $null
|
||||
$Disk.Type | Should Not Be $null
|
||||
$Disk.Name | Should Not Be $null
|
||||
$Disk.ActualSize | Should Not Be $null
|
||||
$Disk.ActualSizeGB | Should Not Be $null
|
||||
$Disk.ProvisionSizeGB | Should Not Be $null
|
||||
$Disk.DiskSku | Should Not Be $null
|
||||
$Disk.ResourceType | Should Not Be $null
|
||||
$Disk.DiskType | Should Not Be $null
|
||||
$Disk.SharePath | Should Not Be $null
|
||||
$Disk.Status | Should Not Be $null
|
||||
$Disk.TenantId | Should Not Be $null
|
||||
$Disk.UserResourceId | Should Not Be $null
|
||||
$Disk.Location | Should Not Be $null
|
||||
$Disk.DiskId | Should Not Be $null
|
||||
}
|
||||
|
@ -98,7 +99,7 @@ InModuleScope Azs.Compute.Admin {
|
|||
$List | Should Not Be $null
|
||||
$Disk | Should Not Be $null
|
||||
|
||||
$diskInList = $List | ?{$_.TenantId.Equals($Disk.TenantId)}
|
||||
$diskInList = $List | ?{$_.UserResourceId.Equals($Disk.UserResourceId)}
|
||||
if($diskInList)
|
||||
{
|
||||
$true
|
||||
|
@ -126,7 +127,7 @@ InModuleScope Azs.Compute.Admin {
|
|||
It "TestListDisks" {
|
||||
$global:TestName = 'TestListDisks'
|
||||
|
||||
$disks = Get-Disk -Location $global:Location
|
||||
$disks = Get-AzsDisk -Location $global:Location
|
||||
|
||||
$disks | Should Not Be $null
|
||||
foreach ($disk in $disks) {
|
||||
|
@ -135,19 +136,19 @@ InModuleScope Azs.Compute.Admin {
|
|||
if($disks.Count -gt 0)
|
||||
{
|
||||
$firstDisk = $disks[0]
|
||||
$tenantSubscriptionId = $($firstDisk.TenantId.Split("/", [System.StringSplitOptions]::RemoveEmptyEntries))[1]
|
||||
$disksForSubscription = Get-Disk -Location $global:Location -TenantSubscriptionId $tenantSubscriptionId
|
||||
ValidateDisksTheSame -DisksRight $($disks | ?{$_.TenantId.Contains($tenantSubscriptionId)}) -DisksLeft $disksForSubscription
|
||||
$tenantSubscriptionId = $($firstDisk.UserResourceId.Split("/", [System.StringSplitOptions]::RemoveEmptyEntries))[1]
|
||||
$disksForSubscription = Get-AzsDisk -Location $global:Location -UserSubscriptionId $tenantSubscriptionId
|
||||
ValidateDisksTheSame -DisksRight $($disks | ?{$_.UserResourceId.Contains($tenantSubscriptionId)}) -DisksLeft $disksForSubscription
|
||||
|
||||
$disksForStatus = Get-Disk -Location $global:Location -Status $firstDisk.Status
|
||||
$disksForStatus = Get-AzsDisk -Location $global:Location -Status $firstDisk.Status
|
||||
ValidateDisksTheSame -DisksRight $($disks | ?{$_.Status.Equals($firstDisk.Status)}) -DisksLeft $disksForStatus
|
||||
|
||||
$disksForShare = Get-Disk -Location $global:Location -SharePath $firstDisk.SharePath
|
||||
$disksForShare = Get-AzsDisk -Location $global:Location -SharePath $firstDisk.SharePath
|
||||
ValidateDisksTheSame -DisksRight $($disks | ?{$_.SharePath.Equals($firstDisk.SharePath)}) -DisksLeft $disksForShare
|
||||
|
||||
if ($disks.Count -ge 2)
|
||||
{
|
||||
$disksWithCountAndStart = Get-Disk -Location $global:Location -Start 1 -Count 1
|
||||
$disksWithCountAndStart = Get-AzsDisk -Location $global:Location -Start 1 -Count 1
|
||||
ValidateDisksTheSame -DisksRight @($disks[1]) -DisksLeft @($disksWithCountAndStart)
|
||||
}
|
||||
}
|
||||
|
@ -156,7 +157,7 @@ InModuleScope Azs.Compute.Admin {
|
|||
It "TestGetDisk" {
|
||||
$global:TestName = 'TestGetDisk'
|
||||
|
||||
$disks = Get-Disk -Location $global:Location
|
||||
$disks = Get-AzsDisk -Location $global:Location
|
||||
|
||||
$disks | Should Not Be $null
|
||||
foreach ($disk in $disks) {
|
||||
|
@ -165,9 +166,15 @@ InModuleScope Azs.Compute.Admin {
|
|||
if($disks.Count -gt 0)
|
||||
{
|
||||
$firstDisk = $disks[0]
|
||||
$diskFromServer = Get-Disk -Location $global:Location -Name $firstDisk.DiskId
|
||||
$diskFromServer = Get-AzsDisk -Location $global:Location -Name $firstDisk.DiskId
|
||||
ValidateDiskTheSame -DiskRight $firstDisk -DiskLeft $diskFromServer
|
||||
}
|
||||
}
|
||||
|
||||
It "TestGetDiskInvalid" {
|
||||
$global:TestName = 'TestGetDiskInvalid'
|
||||
|
||||
{Get-AzsDisk -Location $global:Location -Name "454E5E28-8D5E-41F9-929E-BFF6A7E1A253"} | Should Throw
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,14 +75,14 @@ InModuleScope Azs.Compute.Admin {
|
|||
It "TestDiskMigration" {
|
||||
$global:TestName = 'TestDiskMigration'
|
||||
|
||||
$disks = Get-Disk -Location $global:Location
|
||||
$disks = Get-AzsDisk -Location $global:Location
|
||||
$disks | Should Not Be $null
|
||||
$toMigrationDisks = New-Object System.Collections.Generic.List[Microsoft.AzureStack.Management.Compute.Admin.Models.Disk]
|
||||
$toMigrationDisks = @()
|
||||
foreach($disk in $disks)
|
||||
{
|
||||
if ($toMigrationDisks.Count -lt 3)
|
||||
{
|
||||
$toMigrationDisks.Add($disk);
|
||||
$toMigrationDisks +=$disk;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -91,20 +91,36 @@ InModuleScope Azs.Compute.Admin {
|
|||
}
|
||||
$migrationId = "ba0644a4-c2ed-4e3c-a167-089a32865297"; # this should be the same as session Records
|
||||
|
||||
$migration = New-DiskMigration -Location $global:Location -Name $migrationId -TargetShare $global:TargetShare -Disks $toMigrationDisks
|
||||
$migration = Start-AzsDiskMigrationJob -Location $global:Location -Name $migrationId -TargetShare $global:TargetShare -Disks $disks
|
||||
ValidateDiskMigration -DiskMigration $migration
|
||||
|
||||
$migration = Stop-DiskMigration -Location $global:Location -MigrationId $migration.MigrationId
|
||||
$migration = Stop-AzsDiskMigrationJob -Location $global:Location -Name $migration.MigrationId
|
||||
ValidateDiskMigration -DiskMigration $migration
|
||||
|
||||
$migrationFromGet = Get-DiskMigration -Location $global:Location -Name $migrationId
|
||||
$migrationFromGet = Get-AzsDiskMigrationJob -Location $global:Location -Name $migrationId
|
||||
ValidateDiskMigration -DiskMigration $migrationFromGet
|
||||
|
||||
$migrationList = Get-DiskMigration -Location $global:Location
|
||||
$migrationList = Get-AzsDiskMigrationJob -Location $global:Location
|
||||
$migrationList | %{ValidateDiskMigration -DiskMigration $_ }
|
||||
|
||||
$migrationSucceededList = Get-DiskMigration -Location $global:Location -Status "Succeeded"
|
||||
$migrationSucceededList = Get-AzsDiskMigrationJob -Location $global:Location -Status "Succeeded"
|
||||
$migrationSucceededList | %{ValidateDiskMigration -DiskMigration $_ }
|
||||
}
|
||||
|
||||
It "TestDiskMigrationInvalidInput" {
|
||||
$global:TestName = 'TestDiskMigrationInvalidInput'
|
||||
|
||||
$InvalidtTargetShare = "\\SU1FileServer.azurestack.local\SU1_ObjStore_Invalid\"
|
||||
$disks = @()
|
||||
$disks += Get-AzsDisk -Location $global:Location
|
||||
$disks | Should Not Be $null
|
||||
if($disks.Count -gt 0)
|
||||
{
|
||||
$toMigrationDisks = @($disks[0])
|
||||
$migrationId = "A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2"; # This guid should be the same as the ones in sessionRecord
|
||||
{Start-AzsDiskMigrationJob -Location $global:Location -Name $migrationId -TargetShare $InvalidtTargetShare -Disks $toMigrationDisks} | Should throw
|
||||
{Get-AzsDiskMigrationJob -Location $global:Location -Name $migrationId }| Should throw
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче