Skip to content

Dev #227

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 30 commits into from
Dec 3, 2015
Merged

Dev #227

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
18b0d74
Remove unused file and unify the file name to be consistant with comm…
yantang-msft Nov 24, 2015
45cdc92
Update Stream Analytics PowerShell
atpham256 Nov 25, 2015
f36f2c2
Make -Name an optional parameter for Get and Remove AzureRMVMDiagnost…
yantang-msft Nov 25, 2015
19bd1dc
Make extension name, location, version, auto upgrade as optional para…
yantang-msft Nov 26, 2015
5c3ef55
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yantang-msft Nov 30, 2015
e578340
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
atpham256 Dec 1, 2015
a1bf05b
Merge with dev
atpham256 Dec 1, 2015
bbe91b4
Make StorageContext optional paramter for Set-AzureRmVMDianosticsExte…
yantang-msft Dec 1, 2015
0d11011
Add Hdfs encryption support.
Nov 30, 2015
3b61c84
Merge remote branch and resolve conflicts
yantang-msft Dec 1, 2015
f918286
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
atpham256 Dec 1, 2015
2b737c6
Add more comment per code review feedback
yantang-msft Dec 2, 2015
abd364e
Merge pull request #1389 from yitao-zhang/hdfsencrypt
Dec 2, 2015
484f3bd
Merge pull request #1356 from atpham256/dev
Dec 2, 2015
f177ecb
Rename command class name to reflect the command name
yantang-msft Dec 2, 2015
894b03c
Fix set azure resource when using PatchSemantics switch
vivsriaus Dec 2, 2015
9519997
Merge branch 'dev' of https://github.com/Azure/azure-powershell into …
vivsriaus Dec 2, 2015
f40f412
Update Batch help with MSDN content
Dec 2, 2015
e2619cf
capture new record for set resource
vivsriaus Dec 2, 2015
b44e785
Checking in cmdlet help xmls
bsiva Dec 2, 2015
81a035f
update the help.xml via content development
devigned Nov 19, 2015
9ffca4d
Merge pull request #1381 from yantang-msft/dev
Dec 3, 2015
b4402cc
Merge pull request #1395 from vivsriaus/FixSetResource
Dec 3, 2015
d1f6a7f
added new help file to the csproj
sriramvu Dec 3, 2015
2c87214
updated wxi file with RecoveryServices help file
sriramvu Dec 3, 2015
fb7c698
Merge remote-tracking branch 'upstream/dev' into dev151125
sriramvu Dec 3, 2015
a3c1bda
Merge pull request #1330 from devigned/feature/help-xml
markcowl Dec 3, 2015
89543bd
Merge pull request #1397 from jasper-schneider/batchDocUpdate
markcowl Dec 3, 2015
51c3069
Merge pull request #1399 from AsrArmOneSdk/dev151125
markcowl Dec 3, 2015
ab04982
Merge pull request #226 from Azure/dev
huangpf Dec 3, 2015
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
4 changes: 4 additions & 0 deletions setup/azurecmdfiles.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,9 @@
<Component Id="cmpEDB84317615898A496C0FF620B372C87" Guid="*">
<File Id="fil56F72CE4FFC9F006CE1B279238995FC8" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.RecoveryServices\Microsoft.ApplicationInsights.dll" />
</Component>
<Component Id="cmp66ECF842EEB4EB595925E310358E9750" Guid="*">
<File Id="filF271979440640E53A189C08A7ADBAD7A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.RecoveryServices\Microsoft.Azure.Commands.RecoveryServices.ARM.dll-help.xml" />
</Component>
<Component Id="cmp5CAA968EE7C749E4480233FD90EDFE63" Guid="*">
<File Id="filC143DADE40E067E4692D2246F93BA8A4" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.RecoveryServices\Microsoft.Azure.Commands.RecoveryServices.ARM.dll" />
</Component>
Expand Down Expand Up @@ -5242,6 +5245,7 @@
<ComponentRef Id="cmpC96DAF4A31F86D19246E39394F496F83" />
<ComponentRef Id="cmpA77D5875EABE5151973A245C04E3858E" />
<ComponentRef Id="cmpEDB84317615898A496C0FF620B372C87" />
<ComponentRef Id="cmp66ECF842EEB4EB595925E310358E9750" />
<ComponentRef Id="cmp5CAA968EE7C749E4480233FD90EDFE63" />
<ComponentRef Id="cmpE7C8C6576C1069564C717CBBBD229F39" />
<ComponentRef Id="cmpC9F93119DA28BCE2B325C737951EFABA" />
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,10 @@
<Compile Include="Extension\CustomScript\RemoveAzureVMCustomScriptExtensionCommand.cs" />
<Compile Include="Extension\CustomScript\SetAzureVMCustomScriptExtensionCommand.cs" />
<Compile Include="Extension\CustomScript\VirtualMachineCustomScriptExtensionContext.cs" />
<Compile Include="Extension\Diagnostics\GetAzureVMDiagnosticsExtension.cs" />
<Compile Include="Extension\Diagnostics\RemoveAzureVMDiagnosticsExtension.cs" />
<Compile Include="Extension\Diagnostics\SetAzureVMDiagnosticsExtension.cs" />
<Compile Include="Extension\Diagnostics\DiagnosticsExtensionConstants.cs" />
<Compile Include="Extension\Diagnostics\GetAzureRmVMDiagnosticsExtension.cs" />
<Compile Include="Extension\Diagnostics\RemoveAzureRmVMDiagnosticsExtension.cs" />
<Compile Include="Extension\Diagnostics\SetAzureRmVMDiagnosticsExtension.cs" />
<Compile Include="Extension\DSC\GetAzureVMDscExtensionStatusCommand.cs" />
<Compile Include="Extension\DSC\GetDscResourceException.cs" />
<Compile Include="Extension\DSC\DscExtensionPublishCmdletCommonBase.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,11 @@

namespace Microsoft.Azure.Commands.Compute
{
public class VirtualMachineDiagnosticsExtensionCmdletBase : VirtualMachineExtensionBaseCmdlet
public static class DiagnosticsExtensionConstants
{
protected const string DiagnosticsExtensionNamespace = "Microsoft.Azure.Diagnostics";
protected const string DiagnosticsExtensionType = "IaaSDiagnostics";

protected string StorageAccountName { get; set; }
protected string StorageKey { get; set; }
protected string Endpoint { get; set; }

public VirtualMachineDiagnosticsExtensionCmdletBase()
: base()
{

}
public const string VirtualMachineExtensionResourceType = "Microsoft.Compute/virtualMachines/extensions";
public const string ExtensionDefaultName = "Microsoft.Insights.VMDiagnosticsSettings";
public const string ExtensionPublisher = "Microsoft.Azure.Diagnostics";
public const string ExtensionType = "IaaSDiagnostics";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.Compute.Common;
Expand All @@ -26,7 +27,7 @@ namespace Microsoft.Azure.Commands.Compute
ProfileNouns.VirtualMachineDiagnosticsExtension),
OutputType(
typeof(PSVirtualMachineExtension))]
public class GetAzureVMDiagnosticsExtensionCommand : VirtualMachineExtensionBaseCmdlet
public class GetAzureRmVMDiagnosticsExtensionCommand : VirtualMachineExtensionBaseCmdlet
{
[Parameter(
Mandatory = true,
Expand All @@ -47,11 +48,10 @@ public class GetAzureVMDiagnosticsExtensionCommand : VirtualMachineExtensionBase

[Alias("ExtensionName")]
[Parameter(
Mandatory = true,
Mandatory = false,
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Extension Name.")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

[Parameter(
Expand All @@ -67,6 +67,25 @@ public override void ExecuteCmdlet()

ExecuteClientAction(() =>
{
if (string.IsNullOrEmpty(this.Name))
{
var virtualMachine = ComputeClient.ComputeManagementClient.VirtualMachines.Get(this.ResourceGroupName, this.VMName).VirtualMachine;
var diagnosticsExtension = virtualMachine.Extensions != null
? virtualMachine.Extensions.FirstOrDefault(extension =>
extension.Publisher.Equals(DiagnosticsExtensionConstants.ExtensionPublisher, StringComparison.InvariantCultureIgnoreCase) &&
extension.ExtensionType.Equals(DiagnosticsExtensionConstants.ExtensionType, StringComparison.InvariantCultureIgnoreCase))
: null;

if (diagnosticsExtension == null)
{
WriteObject(null);
return;
}
else {
this.Name = diagnosticsExtension.Name;
}
}

VirtualMachineExtensionGetResponse virtualMachineExtensionGetResponse = null;
if (Status.IsPresent)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@
// ----------------------------------------------------------------------------------

using System;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.Compute.Common;
using Microsoft.Azure.Management.Compute;
using System.Globalization;

namespace Microsoft.Azure.Commands.Compute
{
[Cmdlet(
VerbsCommon.Remove,
ProfileNouns.VirtualMachineDiagnosticsExtension)]
public class RemoveAzureVMDiagnosticsExtensionCommand : VirtualMachineExtensionBaseCmdlet
public class RemoveAzureRmVMDiagnosticsExtensionCommand : VirtualMachineExtensionBaseCmdlet
{
[Parameter(
Mandatory = true,
Expand All @@ -43,11 +45,10 @@ public class RemoveAzureVMDiagnosticsExtensionCommand : VirtualMachineExtensionB

[Alias("ExtensionName")]
[Parameter(
Mandatory = true,
Mandatory = false,
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Extension Name.")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

public override void ExecuteCmdlet()
Expand All @@ -56,6 +57,26 @@ public override void ExecuteCmdlet()

ExecuteClientAction(() =>
{
if (string.IsNullOrEmpty(this.Name))
{
var virtualMachine = ComputeClient.ComputeManagementClient.VirtualMachines.Get(this.ResourceGroupName, this.VMName).VirtualMachine;
var diagnosticsExtension = virtualMachine.Extensions != null
? virtualMachine.Extensions.FirstOrDefault(extension =>
extension.Publisher.Equals(DiagnosticsExtensionConstants.ExtensionPublisher, StringComparison.InvariantCultureIgnoreCase) &&
extension.ExtensionType.Equals(DiagnosticsExtensionConstants.ExtensionType, StringComparison.InvariantCultureIgnoreCase))
: null;

if (diagnosticsExtension == null)
{
WriteWarning(string.Format(CultureInfo.InvariantCulture, Properties.Resources.DiagnosticsExtensionNotFound, this.ResourceGroupName, this.VMName));
return;
}
else
{
this.Name = diagnosticsExtension.Name;
}
}

var op = this.VirtualMachineExtensionClient.Delete(this.ResourceGroupName, this.VMName,
this.Name);
WriteObject(op);
Expand Down
Loading