Skip to content

Update parameter set for actions on Resource Lock #950

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 1 commit into from
Sep 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 @@ -88,16 +88,6 @@ public abstract class ResourceLockManagementCmdletBase : ResourceManagerCmdletBa
[ValidateNotNullOrEmpty]
public string ResourceType { get; set; }

/// <summary>
/// Gets or sets the subscription id parameter.
/// </summary>
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = false, ValueFromPipeline = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The subscription to use.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = false, ValueFromPipeline = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The subscription to use.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = false, ValueFromPipeline = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The subscription to use.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = false, ValueFromPipeline = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The subscription to use.")]
[ValidateNotNullOrEmpty]
public Guid? SubscriptionId { get; set; }

/// <summary>
/// Gets or sets the resource group name parameter.
/// </summary>
Expand All @@ -119,22 +109,6 @@ public abstract class ResourceLockManagementCmdletBase : ResourceManagerCmdletBa
[ValidateNotNullOrEmpty]
public string LockId { get; set; }

/// <summary>
/// Initializes the default subscription id if needed.
/// </summary>
protected override void OnProcessRecord()
{
if (string.IsNullOrWhiteSpace(this.LockId) &&
string.IsNullOrWhiteSpace(this.Scope) &&
this.SubscriptionId == null &&
!this.TenantLevel)
{
this.SubscriptionId = DefaultContext.Subscription.Id;
}

base.OnProcessRecord();
}

/// <summary>
/// Gets the resource Id from the supplied PowerShell parameters.
/// </summary>
Expand All @@ -155,14 +129,14 @@ protected string GetResourceId(string lockName)

throw new InvalidOperationException(string.Format("The Id '{0}' does not belong to a lock.", this.LockId));
}

return !string.IsNullOrWhiteSpace(this.Scope)
? ResourceIdUtility.GetResourceId(
resourceId: this.Scope,
extensionResourceType: Constants.MicrosoftAuthorizationLocksType,
extensionResourceName: lockName)
: ResourceIdUtility.GetResourceId(
subscriptionId: this.SubscriptionId,
subscriptionId: this.DefaultContext.Subscription.Id,
resourceGroupName: this.ResourceGroupName,
resourceType: this.ResourceType,
resourceName: this.ResourceName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1396,13 +1396,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para />
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
<maml:name>ResourceGroupName</maml:name>
<maml:description>
Expand Down Expand Up @@ -1601,13 +1594,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para />
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>ApiVersion</maml:name>
<maml:description>
Expand Down Expand Up @@ -1660,13 +1646,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para />
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
<maml:name>ResourceGroupName</maml:name>
<maml:description>
Expand Down Expand Up @@ -3299,13 +3278,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para>The subscription to use.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
<maml:name>ResourceGroupName</maml:name>
<maml:description>
Expand Down Expand Up @@ -3494,13 +3466,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para>The subscription to use.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>ApiVersion</maml:name>
<maml:description>
Expand Down Expand Up @@ -3581,13 +3546,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para>The subscription to use.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
<maml:name>ResourceGroupName</maml:name>
<maml:description>
Expand Down Expand Up @@ -4631,13 +4589,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para>The subscription to use.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
<maml:name>ResourceGroupName</maml:name>
<maml:description>
Expand Down Expand Up @@ -6111,13 +6062,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para>The subscription to use.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
<maml:name>ResourceGroupName</maml:name>
<maml:description>
Expand Down Expand Up @@ -6306,13 +6250,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para>The subscription to use.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>ApiVersion</maml:name>
<maml:description>
Expand Down Expand Up @@ -6393,13 +6330,6 @@
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para>The subscription to use.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
<maml:name>ResourceGroupName</maml:name>
<maml:description>
Expand Down Expand Up @@ -6627,18 +6557,6 @@
</dev:type>
<dev:defaultValue></dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
<maml:name>SubscriptionId</maml:name>
<maml:description>
<maml:para>The subscription to use.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="true">Nullable`1[Guid]</command:parameterValue>
<dev:type>
<maml:name>Nullable`1[Guid]</maml:name>
<maml:uri/>
</dev:type>
<dev:defaultValue></dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
<maml:name>ResourceGroupName</maml:name>
<maml:description>
Expand Down