Skip to content

AzureRT PR S49 #2 #412

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function Test-VirtualMachineList

try
{
$s1 = Get-AzureVM -All;
$s1 = Get-AzureVM;
$s2 = Get-AzureVM;

if ($s2 -ne $null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using AutoMapper;
using Microsoft.Azure.Commands.Compute.Common;
using Microsoft.Azure.Commands.Compute.Models;
using Microsoft.Azure.Management.Compute;
using Microsoft.Azure.Management.Compute.Models;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Compute
{
[Cmdlet(VerbsCommon.New, ProfileNouns.AvailabilitySet)]
[OutputType(typeof(PSAvailabilitySet))]
public class NewAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
{
[Parameter(
Expand Down Expand Up @@ -73,11 +76,12 @@ public override void ExecuteCmdlet()
PlatformFaultDomainCount = this.PlatformFaultDomainCount
};

var op = this.AvailabilitySetClient.CreateOrUpdate(
var result = this.AvailabilitySetClient.CreateOrUpdate(
this.ResourceGroupName,
avSetParams);

WriteObject(op);
var psResult = Mapper.Map<PSAvailabilitySet>(result.AvailabilitySet);
WriteObject(psResult);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
<Compile Include="Extension\GetAzureVMExtensionCommand.cs" />
<Compile Include="Images\GetAzureVMImageCommand.cs" />
<Compile Include="Models\HashTableExtensions.cs" />
<Compile Include="Models\PSComputeLongRunningOperation.cs" />
<Compile Include="Models\PSOperation.cs" />
<Compile Include="Extension\VMAccess\GetAzureVMAccessExtension.cs" />
<Compile Include="Extension\VMAccess\RemoveAzureVMAccessExtension.cs" />
Expand Down Expand Up @@ -253,6 +254,9 @@
<None Include="Microsoft.Azure.Commands.Compute.dll-Help.psd1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Microsoft.Azure.Commands.Compute.format.generated.ps1xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Microsoft.Azure.Commands.Compute.format.ps1xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ protected override void Configure()
Mapper.CreateMap<FROM.VirtualMachine, TO.PSVirtualMachine>();
Mapper.CreateMap<FROM.VirtualMachineSize, TO.PSVirtualMachineSize>();
Mapper.CreateMap<FROM.Usage, TO.PSUsage>();

Mapper.CreateMap<FROM.ComputeLongRunningOperationResponse, TO.PSComputeLongRunningOperation>();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using AutoMapper;
using Microsoft.Azure.Commands.Compute.Common;
using Microsoft.Azure.Commands.Compute.Models;
using Microsoft.Azure.Management.Compute;
using Microsoft.Azure.Management.Compute.Models;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Compute
{
[Cmdlet(VerbsCommon.Remove, ProfileNouns.VirtualMachineExtension)]
[OutputType(typeof(ComputeLongRunningOperationResponse))]
[OutputType(typeof(PSComputeLongRunningOperation))]
public class RemoveAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
{
[Parameter(
Expand Down Expand Up @@ -61,7 +62,8 @@ public override void ExecuteCmdlet()
|| this.ShouldContinue(Properties.Resources.VirtualMachineExtensionRemovalConfirmation, Properties.Resources.VirtualMachineExtensionRemovalCaption))
{
var op = this.VirtualMachineExtensionClient.Delete(this.ResourceGroupName, this.VMName, this.Name);
WriteObject(op);
var result = Mapper.Map<PSComputeLongRunningOperation>(op);
WriteObject(result);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using AutoMapper;
using Microsoft.Azure.Commands.Compute.Common;
using Microsoft.Azure.Commands.Compute.Models;
using Microsoft.Azure.Management.Compute;
using Microsoft.Azure.Management.Compute.Models;
using Newtonsoft.Json;
Expand All @@ -25,6 +27,7 @@ namespace Microsoft.Azure.Commands.Compute
VerbsCommon.Set,
ProfileNouns.VirtualMachineExtension,
DefaultParameterSetName = SettingsParamSet)]
[OutputType(typeof(PSComputeLongRunningOperation))]
public class SetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
{
protected const string SettingStringParamSet = "SettingString";
Expand Down Expand Up @@ -124,8 +127,6 @@ public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();



if (this.Settings != null)
{
this.SettingString = JsonConvert.SerializeObject(Settings);
Expand All @@ -149,7 +150,8 @@ public override void ExecuteCmdlet()
this.VMName,
parameters);

WriteObject(op);
var result = Mapper.Map<PSComputeLongRunningOperation>(op);
WriteObject(result);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ TypesToProcess = @(

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @(
'.\Microsoft.Azure.Commands.Compute.format.ps1xml'
'.\Microsoft.Azure.Commands.Compute.format.ps1xml',
'.\Microsoft.Azure.Commands.Compute.format.generated.ps1xml'
)

# Modules to import as nested modules of the module specified in ModuleToProcess
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//

// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
-->
<Configuration>
<ViewDefinitions>
<View>
<Name>Microsoft.Azure.Commands.Compute.Models.PSAvailabilitySet</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.Commands.Compute.Models.PSAvailabilitySet</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<Label>ResourceGroupName</Label>
<PropertyName>ResourceGroupName</PropertyName>
</ListItem>
<ListItem>
<Label>Id</Label>
<PropertyName>Id</PropertyName>
</ListItem>
<ListItem>
<Label>Name</Label>
<PropertyName>Name</PropertyName>
</ListItem>
<ListItem>
<Label>Type</Label>
<PropertyName>Type</PropertyName>
</ListItem>
<ListItem>
<Label>Location</Label>
<PropertyName>Location</PropertyName>
</ListItem>
<ListItem>
<Label>Tags</Label>
<PropertyName>TagsText</PropertyName>
</ListItem>
<ListItem>
<Label>PlatformFaultDomainCount</Label>
<PropertyName>PlatformFaultDomainCount</PropertyName>
</ListItem>
<ListItem>
<Label>PlatformUpdateDomainCount</Label>
<PropertyName>PlatformUpdateDomainCount</PropertyName>
</ListItem>
<ListItem>
<Label>Statuses</Label>
<PropertyName>StatusesText</PropertyName>
</ListItem>
<ListItem>
<Label>VirtualMachinesReferences</Label>
<PropertyName>VirtualMachinesReferencesText</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
<View>
<Name>Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineSize</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineSize</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<Label>MaxDataDiskCount</Label>
<PropertyName>MaxDataDiskCount</PropertyName>
</ListItem>
<ListItem>
<Label>MemoryInMB</Label>
<PropertyName>MemoryInMB</PropertyName>
</ListItem>
<ListItem>
<Label>Name</Label>
<PropertyName>Name</PropertyName>
</ListItem>
<ListItem>
<Label>NumberOfCores</Label>
<PropertyName>NumberOfCores</PropertyName>
</ListItem>
<ListItem>
<Label>OSDiskSizeInMB</Label>
<PropertyName>OSDiskSizeInMB</PropertyName>
</ListItem>
<ListItem>
<Label>ResourceDiskSizeInMB</Label>
<PropertyName>ResourceDiskSizeInMB</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
<View>
<Name>Microsoft.Azure.Commands.Compute.Models.PSUsage</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.Commands.Compute.Models.PSUsage</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<Label>CurrentValue</Label>
<PropertyName>CurrentValue</PropertyName>
</ListItem>
<ListItem>
<Label>Limit</Label>
<PropertyName>Limit</PropertyName>
</ListItem>
<ListItem>
<Label>Name</Label>
<PropertyName>NameText</PropertyName>
</ListItem>
<ListItem>
<Label>Unit</Label>
<PropertyName>UnitText</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
<View>
<Name>Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<Label>ResourceGroupName</Label>
<PropertyName>ResourceGroupName</PropertyName>
</ListItem>
<ListItem>
<Label>Id</Label>
<PropertyName>Id</PropertyName>
</ListItem>
<ListItem>
<Label>Name</Label>
<PropertyName>Name</PropertyName>
</ListItem>
<ListItem>
<Label>Type</Label>
<PropertyName>Type</PropertyName>
</ListItem>
<ListItem>
<Label>Location</Label>
<PropertyName>Location</PropertyName>
</ListItem>
<ListItem>
<Label>Tags</Label>
<PropertyName>TagsText</PropertyName>
</ListItem>
<ListItem>
<Label>AvailabilitySetReference</Label>
<PropertyName>AvailabilitySetReferenceText</PropertyName>
</ListItem>
<ListItem>
<Label>Extensions</Label>
<PropertyName>ExtensionsText</PropertyName>
</ListItem>
<ListItem>
<Label>HardwareProfile</Label>
<PropertyName>HardwareProfileText</PropertyName>
</ListItem>
<ListItem>
<Label>InstanceView</Label>
<PropertyName>InstanceViewText</PropertyName>
</ListItem>
<ListItem>
<Label>NetworkProfile</Label>
<PropertyName>NetworkProfileText</PropertyName>
</ListItem>
<ListItem>
<Label>OSProfile</Label>
<PropertyName>OSProfileText</PropertyName>
</ListItem>
<ListItem>
<Label>Plan</Label>
<PropertyName>PlanText</PropertyName>
</ListItem>
<ListItem>
<Label>ProvisioningState</Label>
<PropertyName>ProvisioningState</PropertyName>
</ListItem>
<ListItem>
<Label>StorageProfile</Label>
<PropertyName>StorageProfileText</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
</ViewDefinitions>
</Configuration>
Loading