Skip to content

Commit

Permalink
Merge pull request Azure#3870 from hyonholee/dev
Browse files Browse the repository at this point in the history
[AzureRT] May update
  • Loading branch information
cormacpayne authored May 3, 2017
2 parents 938bfe9 + a96b735 commit b38dfd9
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 57 deletions.
3 changes: 3 additions & 0 deletions src/ResourceManager/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
* Updated Set-AzureRmVMAEMExtension and Test-AzureRmVMAEMExtension cmdlets to support Premium managed disks
* Backup encryption settings for IaaS VMs and restore on failure
* ChefServiceInterval option is renamed to ChefDaemonInterval now. Old one will continue to work however.
* Remove duplicated DataDiskNames and NetworkInterfaceIDs properties from PS VM object.
- Make DataDiskNames and NetworkInterfaceIDs parameters optional in Remove-AzureRmVMDataDisk and Remove-AzureRmVMNetworkInterface, respectively.
* Fix the piping issue of Get cmdlets when the Get cmdlets return a list object.

## Version 2.9.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function Test-VirtualMachineProfile
$p = Add-AzureRmVMDataDisk -VM $p -Name 'testDataDisk3' -Caching 'ReadOnly' -DiskSizeInGB $null -Lun 2 -VhdUri $dataDiskVhdUri3 -CreateOption Empty;
Assert-Null $p.StorageProfile.DataDisks[2].DiskSizeGB;
$p = Remove-AzureRmVMDataDisk -VM $p -Name 'testDataDisk3';

Assert-AreEqual $p.StorageProfile.OSDisk.Caching $osDiskCaching;
Assert-AreEqual $p.StorageProfile.OSDisk.Name $osDiskName;
Assert-AreEqual $p.StorageProfile.OSDisk.Vhd.Uri $osDiskVhdUri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,10 @@ function Test-VirtualMachineScaleSetLB

# List All
Write-Verbose ('Running Command : ' + 'Get-AzureRmVmss ListAll');
$vmssList = Get-AzureRmVmss;
$vmssList = Get-AzureRmVmss | ? Name -like 'vmsscrptestps*';
Assert-True { ($vmssList | select -ExpandProperty Name) -contains $vmssName };
$output = $vmssList | Out-String;
Assert-AreEqual 1 $vmssList.Count
Write-Verbose ($output);
Assert-False { $output.Contains("VirtualMachineProfile") };

Expand Down Expand Up @@ -624,7 +625,7 @@ function Test-VirtualMachineScaleSetNextLink

$result = New-AzureRmVmss -ResourceGroupName $rgname -Name $vmssName -VirtualMachineScaleSet $vmss;

$vmssVmResult = Get-AzureRmVmssVM -ResourceGroupName $rgname -VMScaleSetName $vmssName;
$vmssVmResult = Get-AzureRmVmssVM -ResourceGroupName $rgname -VMScaleSetName $vmssName | ? Name -like 'vmsscrptestps*';
Assert-AreEqual $vmss_number $vmssVmResult.Count
}
finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected void ExecuteAvailabilitySetGetMethod(object[] invokeMethodInputParamet
{
psObject.Add(Mapper.Map<AvailabilitySet, PSAvailabilitySetList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected void ExecuteContainerServiceGetMethod(object[] invokeMethodInputParame
{
psObject.Add(Mapper.Map<ContainerService, PSContainerServiceList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
else
{
Expand All @@ -127,7 +127,7 @@ protected void ExecuteContainerServiceGetMethod(object[] invokeMethodInputParame
{
psObject.Add(Mapper.Map<ContainerService, PSContainerServiceList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected void ExecuteDiskGetMethod(object[] invokeMethodInputParameters)
{
psObject.Add(Mapper.Map<Disk, PSDiskList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
else
{
Expand All @@ -127,7 +127,7 @@ protected void ExecuteDiskGetMethod(object[] invokeMethodInputParameters)
{
psObject.Add(Mapper.Map<Disk, PSDiskList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected void ExecuteImageGetMethod(object[] invokeMethodInputParameters)
{
psObject.Add(Mapper.Map<Image, PSImageList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
else
{
Expand All @@ -140,7 +140,7 @@ protected void ExecuteImageGetMethod(object[] invokeMethodInputParameters)
{
psObject.Add(Mapper.Map<Image, PSImageList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected void ExecuteSnapshotGetMethod(object[] invokeMethodInputParameters)
{
psObject.Add(Mapper.Map<Snapshot, PSSnapshotList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
else
{
Expand All @@ -127,7 +127,7 @@ protected void ExecuteSnapshotGetMethod(object[] invokeMethodInputParameters)
{
psObject.Add(Mapper.Map<Snapshot, PSSnapshotList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected void ExecuteVirtualMachineGetMethod(object[] invokeMethodInputParamete
{
psObject.Add(Mapper.Map<VirtualMachine, PSVirtualMachineList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
else
{
Expand All @@ -140,7 +140,7 @@ protected void ExecuteVirtualMachineGetMethod(object[] invokeMethodInputParamete
{
psObject.Add(Mapper.Map<VirtualMachine, PSVirtualMachineList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected void ExecuteVirtualMachineScaleSetGetMethod(object[] invokeMethodInput
{
psObject.Add(Mapper.Map<VirtualMachineScaleSet, PSVirtualMachineScaleSetList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
else
{
Expand All @@ -127,7 +127,7 @@ protected void ExecuteVirtualMachineScaleSetGetMethod(object[] invokeMethodInput
{
psObject.Add(Mapper.Map<VirtualMachineScaleSet, PSVirtualMachineScaleSetList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected void ExecuteVirtualMachineScaleSetVMGetMethod(object[] invokeMethodInp
{
psObject.Add(Mapper.Map<VirtualMachineScaleSetVM, PSVirtualMachineScaleSetVMList>(r));
}
WriteObject(psObject);
WriteObject(psObject, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,36 +91,6 @@ public string ResourceGroupName
// Gets or sets the storage profile.
public StorageProfile StorageProfile { get; set; }

[JsonIgnore]
public string[] DataDiskNames
{
get
{
if (this.StorageProfile == null || this.StorageProfile.DataDisks == null) return null;
var listStr = new List<string>();
foreach (var item in StorageProfile.DataDisks)
{
listStr.Add(item.Name);
}
return listStr.ToArray();
}
}

[JsonIgnore]
public string[] NetworkInterfaceIDs
{
get
{
if (this.NetworkProfile == null || this.NetworkProfile.NetworkInterfaces == null) return null;
var listStr = new List<string>();
foreach (var item in NetworkProfile.NetworkInterfaces)
{
listStr.Add(item.Id);
}
return listStr.ToArray();
}
}

public DisplayHintType DisplayHint { get; set; }

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public class RemoveAzureVMDataDiskCommand : Microsoft.Azure.Commands.ResourceMan

[Alias("Name")]
[Parameter(
Mandatory = true,
Mandatory = false,
Position = 1,
ValueFromPipelineByPropertyName = true,
ValueFromPipelineByPropertyName = false,
HelpMessage = HelpMessages.VMDataDiskName)]
[ValidateNotNullOrEmpty]
public string[] DataDiskNames { get; set; }
Expand All @@ -51,8 +51,6 @@ public override void ExecuteCmdlet()
{
if (this.ShouldProcess("DataDisk", VerbsCommon.Remove))
{
WriteWarning("Breaking change notice: In upcoming release, DataDiskNames parameter will no longer support pipeline. This parameter will be optional. All data disks will be removed from a given VM object if a user does not give this parameter.");

var storageProfile = this.VM.StorageProfile;

if (storageProfile != null && storageProfile.DataDisks != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public class RemoveAzureVMNetworkInterfaceCommand : Microsoft.Azure.Commands.Res

[Alias("Id", "NicIds")]
[Parameter(
Mandatory = true,
Mandatory = false,
Position = 1,
ValueFromPipelineByPropertyName = true,
ValueFromPipelineByPropertyName = false,
HelpMessage = HelpMessages.VMNetworkInterfaceID)]
[ValidateNotNullOrEmpty]
public string[] NetworkInterfaceIDs { get; set; }
Expand All @@ -54,8 +54,6 @@ public override void ExecuteCmdlet()
{
if (this.ShouldProcess("NetworkInterface", VerbsCommon.Remove))
{
WriteWarning("Breaking change notice: In upcoming release, NetworkInterfaceIDs will no longer support pipeline. This parameter will be optional. All network interfaces will be removed from a given VM object if a user does not give this parameter.");

var networkProfile = this.VM.NetworkProfile;

if (NetworkInterfaceIDs == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();

WriteWarning("Breaking change notice: In upcoming release, top level properties, DataDiskNames and NetworkInterfaceIDs, will be removed from VM object because they are also in StorageProfile and NetworkProfile, respectively.");

ExecuteClientAction(() =>
{
if (string.IsNullOrEmpty(this.ResourceGroupName) && string.IsNullOrEmpty(this.Name))
Expand Down
Loading

0 comments on commit b38dfd9

Please sign in to comment.