Skip to content

Commit

Permalink
Merge pull request Azure#46 from zyxyoshine/fix
Browse files Browse the repository at this point in the history
Update storage part of Fabric Admin and Compute Admin
  • Loading branch information
bganapa authored Feb 18, 2020
2 parents 08a4dcd + 348668d commit 61e1df6
Show file tree
Hide file tree
Showing 16 changed files with 284 additions and 532 deletions.
146 changes: 146 additions & 0 deletions src/Azs.Compute.Admin/custom/New-AzsDiskMigrationJob.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@

# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------
<#
.Synopsis
Create a disk migration job.
.Description
Create a disk migration job.
.Example
To view examples, please use the -Online parameter with Get-Help or navigate to: https://docs.microsoft.com/en-us/powershell/module/azs.compute.admin/new-azsdiskmigrationjob
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Models.Api20180730Preview.IDisk[]
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Models.Api20180730Preview.IDiskMigrationJob
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
DISKS <IDisk[]>: .
[Location <String>]: Location of the resource.
[DiskId <String>]: The disk id.
[SharePath <String>]: The disk share path.
[Status <DiskState?>]: The disk status.
.Link
https://docs.microsoft.com/en-us/powershell/module/azs.compute.admin/new-azsdiskmigrationjob
#>
function New-AzsDiskMigrationJob {
[Alias('Start-AzsDiskMigrationJob')]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Models.Api20180730Preview.IDiskMigrationJob])]
[CmdletBinding(DefaultParameterSetName='Volume', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
[Alias('MigrationId')]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Path')]
[System.String]
# The migration job guid name.
${Name},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Runtime.DefaultInfo(Script='(Get-AzLocation)[0].Location')]
[System.String]
# Location of the resource.
${Location},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
# Subscription credentials that uniquely identify Microsoft Azure subscription.
# The subscription ID forms part of the URI for every service call.
${SubscriptionId},

[Parameter(ParameterSetName='Volume', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Query')]
[System.String]
# The target scale unit name.
${TargetScaleUnit},

[Parameter(ParameterSetName='Share', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Query')]
[System.String]
# The target share name.
${TargetShare},

[Parameter(ParameterSetName='Volume', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Query')]
[System.String]
# The target volume label.
${TargetVolumeLabel},

[Parameter(Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Models.Api20180730Preview.IDisk[]]
# .
# To construct, see NOTES section for DISKS properties and create a hash table.
${Disks},

[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Azure')]
[System.Management.Automation.PSObject]
# The credentials, account, tenant, and subscription used for communication with Azure.
${DefaultProfile},

[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
${Break},

[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Runtime.SendAsyncStep[]]
# SendAsync Pipeline Steps to be appended to the front of the pipeline
${HttpPipelineAppend},

[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Runtime.SendAsyncStep[]]
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
${HttpPipelinePrepend},

[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Runtime')]
[System.Uri]
# The URI for the proxy server to use
${Proxy},

[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Runtime')]
[System.Management.Automation.PSCredential]
# Credentials for a proxy server to use for the remote call
${ProxyCredential},

[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.ComputeAdmin.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)

process {
if ('Share' -eq $PsCmdlet.ParameterSetName)
{
Write-Warning "TargetShare parameter will be deprecated in a future release, please use Volume instead."
}

Azs.Compute.Admin.internal\New-AzsDiskMigrationJob @PSBoundParameters
}
}
13 changes: 13 additions & 0 deletions src/Azs.Compute.Admin/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,5 +308,18 @@ directive:
set:
parameter-name: Name

# Remove CancelViaIdentity parameter set in Stop-AzsDiskMigrationJob
- where:
verb: Stop
subject: DiskMigrationJob
variant: CancelViaIdentity
remove: true

# Hide the auto-generated New-AzsDiskMigrationJob and expose it through customized one
- where:
verb: New
subject: DiskMigrationJob
hide: true

subject-prefix: ''
module-version: 0.0.1
14 changes: 13 additions & 1 deletion src/Azs.Fabric.Admin/custom/Get-AzsDrive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@ To create the parameters described below, construct a hash table containing the
INPUTOBJECT <IFabricAdminIdentity>: Identity Parameter
[Drive <String>]: Name of the storage drive.
[EdgeGateway <String>]: Name of the edge gateway.
[EdgeGatewayPool <String>]: Name of the edge gateway pool.
[FabricLocation <String>]: Fabric location.
[FileShare <String>]: Fabric file share name.
[IPPool <String>]: IP pool name.
[Id <String>]: Resource identity path
[InfraRole <String>]: Infrastructure role name.
[InfraRoleInstance <String>]: Name of an infrastructure role instance.
[Location <String>]: Location of the resource.
[LogicalNetwork <String>]: Name of the logical network.
[LogicalSubnet <String>]: Name of the logical subnet.
[MacAddressPool <String>]: Name of the MAC address pool.
[Operation <String>]: Operation identifier.
[ResourceGroupName <String>]: Name of the resource group.
[ScaleUnit <String>]: Name of the scale units.
[ScaleUnitNode <String>]: Name of the scale unit node.
[SlbMuxInstance <String>]: Name of a SLB MUX instance.
[StorageSubSystem <String>]: Name of the storage system.
[SubscriptionId <String>]: Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
[Volume <String>]: Name of the storage volume.
Expand Down Expand Up @@ -47,7 +59,7 @@ param(
[Parameter(ParameterSetName='Get')]
[Parameter(ParameterSetName='List')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Name)')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Location)')]
[System.String]
# Name of the resource group.
${ResourceGroupName},
Expand Down
14 changes: 13 additions & 1 deletion src/Azs.Fabric.Admin/custom/Get-AzsInfrastructureShare.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@ To create the parameters described below, construct a hash table containing the
INPUTOBJECT <IFabricAdminIdentity>: Identity Parameter
[Drive <String>]: Name of the storage drive.
[EdgeGateway <String>]: Name of the edge gateway.
[EdgeGatewayPool <String>]: Name of the edge gateway pool.
[FabricLocation <String>]: Fabric location.
[FileShare <String>]: Fabric file share name.
[IPPool <String>]: IP pool name.
[Id <String>]: Resource identity path
[InfraRole <String>]: Infrastructure role name.
[InfraRoleInstance <String>]: Name of an infrastructure role instance.
[Location <String>]: Location of the resource.
[LogicalNetwork <String>]: Name of the logical network.
[LogicalSubnet <String>]: Name of the logical subnet.
[MacAddressPool <String>]: Name of the MAC address pool.
[Operation <String>]: Operation identifier.
[ResourceGroupName <String>]: Name of the resource group.
[ScaleUnit <String>]: Name of the scale units.
[ScaleUnitNode <String>]: Name of the scale unit node.
[SlbMuxInstance <String>]: Name of a SLB MUX instance.
[StorageSubSystem <String>]: Name of the storage system.
[SubscriptionId <String>]: Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
[Volume <String>]: Name of the storage volume.
Expand Down Expand Up @@ -47,7 +59,7 @@ param(
[Parameter(ParameterSetName='Get')]
[Parameter(ParameterSetName='List')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Name)')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Location)')]
[System.String]
# Name of the resource group.
${ResourceGroupName},
Expand Down
14 changes: 13 additions & 1 deletion src/Azs.Fabric.Admin/custom/Get-AzsStorageSubSystem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@ To create the parameters described below, construct a hash table containing the
INPUTOBJECT <IFabricAdminIdentity>: Identity Parameter
[Drive <String>]: Name of the storage drive.
[EdgeGateway <String>]: Name of the edge gateway.
[EdgeGatewayPool <String>]: Name of the edge gateway pool.
[FabricLocation <String>]: Fabric location.
[FileShare <String>]: Fabric file share name.
[IPPool <String>]: IP pool name.
[Id <String>]: Resource identity path
[InfraRole <String>]: Infrastructure role name.
[InfraRoleInstance <String>]: Name of an infrastructure role instance.
[Location <String>]: Location of the resource.
[LogicalNetwork <String>]: Name of the logical network.
[LogicalSubnet <String>]: Name of the logical subnet.
[MacAddressPool <String>]: Name of the MAC address pool.
[Operation <String>]: Operation identifier.
[ResourceGroupName <String>]: Name of the resource group.
[ScaleUnit <String>]: Name of the scale units.
[ScaleUnitNode <String>]: Name of the scale unit node.
[SlbMuxInstance <String>]: Name of a SLB MUX instance.
[StorageSubSystem <String>]: Name of the storage system.
[SubscriptionId <String>]: Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
[Volume <String>]: Name of the storage volume.
Expand Down Expand Up @@ -47,7 +59,7 @@ param(
[Parameter(ParameterSetName='Get')]
[Parameter(ParameterSetName='List')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Name)')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Location)')]
[System.String]
# Name of the resource group.
${ResourceGroupName},
Expand Down
14 changes: 13 additions & 1 deletion src/Azs.Fabric.Admin/custom/Get-AzsVolume.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@ To create the parameters described below, construct a hash table containing the
INPUTOBJECT <IFabricAdminIdentity>: Identity Parameter
[Drive <String>]: Name of the storage drive.
[EdgeGateway <String>]: Name of the edge gateway.
[EdgeGatewayPool <String>]: Name of the edge gateway pool.
[FabricLocation <String>]: Fabric location.
[FileShare <String>]: Fabric file share name.
[IPPool <String>]: IP pool name.
[Id <String>]: Resource identity path
[InfraRole <String>]: Infrastructure role name.
[InfraRoleInstance <String>]: Name of an infrastructure role instance.
[Location <String>]: Location of the resource.
[LogicalNetwork <String>]: Name of the logical network.
[LogicalSubnet <String>]: Name of the logical subnet.
[MacAddressPool <String>]: Name of the MAC address pool.
[Operation <String>]: Operation identifier.
[ResourceGroupName <String>]: Name of the resource group.
[ScaleUnit <String>]: Name of the scale units.
[ScaleUnitNode <String>]: Name of the scale unit node.
[SlbMuxInstance <String>]: Name of a SLB MUX instance.
[StorageSubSystem <String>]: Name of the storage system.
[SubscriptionId <String>]: Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
[Volume <String>]: Name of the storage volume.
Expand Down Expand Up @@ -47,7 +59,7 @@ param(
[Parameter(ParameterSetName='Get')]
[Parameter(ParameterSetName='List')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Name)')]
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Location)')]
[System.String]
# Name of the resource group.
${ResourceGroupName},
Expand Down
16 changes: 14 additions & 2 deletions src/Azs.Fabric.Admin/docs/Get-AzsDrive.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Aliases:

Required: False
Position: Named
Default value: (Get-AzLocation)[0].Name
Default value: (Get-AzLocation)[0].Location
Accept pipeline input: False
Accept wildcard characters: False
Dynamic: False
Expand Down Expand Up @@ -159,7 +159,7 @@ Aliases:

Required: False
Position: Named
Default value: -join("System.",(Get-AzLocation)[0].Name)
Default value: -join("System.",(Get-AzLocation)[0].Location)
Accept pipeline input: False
Accept wildcard characters: False
Dynamic: False
Expand Down Expand Up @@ -266,11 +266,23 @@ To create the parameters described below, construct a hash table containing the
#### INPUTOBJECT <IFabricAdminIdentity>: Identity Parameter
- `[Drive <String>]`: Name of the storage drive.
- `[EdgeGateway <String>]`: Name of the edge gateway.
- `[EdgeGatewayPool <String>]`: Name of the edge gateway pool.
- `[FabricLocation <String>]`: Fabric location.
- `[FileShare <String>]`: Fabric file share name.
- `[IPPool <String>]`: IP pool name.
- `[Id <String>]`: Resource identity path
- `[InfraRole <String>]`: Infrastructure role name.
- `[InfraRoleInstance <String>]`: Name of an infrastructure role instance.
- `[Location <String>]`: Location of the resource.
- `[LogicalNetwork <String>]`: Name of the logical network.
- `[LogicalSubnet <String>]`: Name of the logical subnet.
- `[MacAddressPool <String>]`: Name of the MAC address pool.
- `[Operation <String>]`: Operation identifier.
- `[ResourceGroupName <String>]`: Name of the resource group.
- `[ScaleUnit <String>]`: Name of the scale units.
- `[ScaleUnitNode <String>]`: Name of the scale unit node.
- `[SlbMuxInstance <String>]`: Name of a SLB MUX instance.
- `[StorageSubSystem <String>]`: Name of the storage system.
- `[SubscriptionId <String>]`: Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
- `[Volume <String>]`: Name of the storage volume.
Expand Down
16 changes: 14 additions & 2 deletions src/Azs.Fabric.Admin/docs/Get-AzsInfrastructureShare.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Aliases:

Required: False
Position: Named
Default value: (Get-AzLocation)[0].Name
Default value: (Get-AzLocation)[0].Location
Accept pipeline input: False
Accept wildcard characters: False
Dynamic: False
Expand Down Expand Up @@ -159,7 +159,7 @@ Aliases:

Required: False
Position: Named
Default value: -join("System.",(Get-AzLocation)[0].Name)
Default value: -join("System.",(Get-AzLocation)[0].Location)
Accept pipeline input: False
Accept wildcard characters: False
Dynamic: False
Expand Down Expand Up @@ -234,11 +234,23 @@ To create the parameters described below, construct a hash table containing the
#### INPUTOBJECT <IFabricAdminIdentity>: Identity Parameter
- `[Drive <String>]`: Name of the storage drive.
- `[EdgeGateway <String>]`: Name of the edge gateway.
- `[EdgeGatewayPool <String>]`: Name of the edge gateway pool.
- `[FabricLocation <String>]`: Fabric location.
- `[FileShare <String>]`: Fabric file share name.
- `[IPPool <String>]`: IP pool name.
- `[Id <String>]`: Resource identity path
- `[InfraRole <String>]`: Infrastructure role name.
- `[InfraRoleInstance <String>]`: Name of an infrastructure role instance.
- `[Location <String>]`: Location of the resource.
- `[LogicalNetwork <String>]`: Name of the logical network.
- `[LogicalSubnet <String>]`: Name of the logical subnet.
- `[MacAddressPool <String>]`: Name of the MAC address pool.
- `[Operation <String>]`: Operation identifier.
- `[ResourceGroupName <String>]`: Name of the resource group.
- `[ScaleUnit <String>]`: Name of the scale units.
- `[ScaleUnitNode <String>]`: Name of the scale unit node.
- `[SlbMuxInstance <String>]`: Name of a SLB MUX instance.
- `[StorageSubSystem <String>]`: Name of the storage system.
- `[SubscriptionId <String>]`: Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
- `[Volume <String>]`: Name of the storage volume.
Expand Down
Loading

0 comments on commit 61e1df6

Please sign in to comment.