Skip to content

Bring PowerShell in parity with API for LockLevel #2619

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
Jul 19, 2016
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 @@ -20,8 +20,13 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.Locks
public enum LockLevel
{
/// <summary>
/// The cannot delete lock.
/// The lock blocks delete.
/// </summary>
CanNotDelete,

/// <summary>
/// The lock blocks all updates and delete.
/// </summary>
ReadOnly
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2955,7 +2955,7 @@
<dev:version />
</command:details>
<maml:description>
<maml:para>Create a new resource lock. Resource Locks are useful to prevent accidental deletions of your azure resources. Once a lock is placed on a resource, it can't be deleted unless the lock is removed. </maml:para>
<maml:para>Create a new resource lock. Resource Lock is useful to prevent accidental deletion or update of your azure resource. Once a lock is placed on a resource, based on lock level it can't be deleted or updated unless the lock is removed. </maml:para>
<maml:para>If you find an issue with this cmdlet, please create an issue on https://github.com/Azure/azure-powershell/issues, with a lable "ResourceManager".</maml:para>
</maml:description>
<command:syntax>
Expand All @@ -2964,7 +2964,9 @@
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>LockLevel</maml:name>
<maml:description>
<maml:para>The level of the lock. The currently supported lock level is "CannotDelete". When this level is set on a resource, that resource cannont be deleted unless the lock is removed. </maml:para>
<maml:para>The level of the lock. The currently supported lock levels are "CannotDelete" and "ReadOnly". </maml:para>
<maml:para>CannotDelete - When this level is set on a resource, that resource cannot be deleted unless the lock is removed.</maml:para>
<maml:para>ReadOnly - When this level is set on a resource, that resource cannot updated or deleted unless the lock is removed.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">LockLevel</command:parameterValue>
</command:parameter>
Expand Down Expand Up @@ -3058,7 +3060,9 @@
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>LockLevel</maml:name>
<maml:description>
<maml:para>The level of the lock. The currently supported lock level is "CannotDelete". When this level is set on a resource, that resource cannont be deleted unless the lock is removed. </maml:para>
<maml:para>The level of the lock. The currently supported lock levels are "CannotDelete" and "ReadOnly". </maml:para>
<maml:para>CannotDelete - When this level is set on a resource, that resource cannot be deleted unless the lock is removed.</maml:para>
<maml:para>ReadOnly - When this level is set on a resource, that resource cannot updated or deleted unless the lock is removed.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">LockLevel</command:parameterValue>
</command:parameter>
Expand Down Expand Up @@ -3145,7 +3149,9 @@
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>LockLevel</maml:name>
<maml:description>
<maml:para>The level of the lock. The currently supported lock level is "CannotDelete". When this level is set on a resource, that resource cannont be deleted unless the lock is removed. </maml:para>
<maml:para>The level of the lock. The currently supported lock levels are "CannotDelete" and "ReadOnly". </maml:para>
<maml:para>CannotDelete - When this level is set on a resource, that resource cannot be deleted unless the lock is removed.</maml:para>
<maml:para>ReadOnly - When this level is set on a resource, that resource cannot updated or deleted unless the lock is removed.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">LockLevel</command:parameterValue>
</command:parameter>
Expand Down Expand Up @@ -3246,7 +3252,9 @@
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>LockLevel</maml:name>
<maml:description>
<maml:para>The level of the lock. The currently supported lock level is "CannotDelete". When this level is set on a resource, that resource cannont be deleted unless the lock is removed. </maml:para>
<maml:para>The level of the lock. The currently supported lock levels are "CannotDelete" and "ReadOnly". </maml:para>
<maml:para>CannotDelete - When this level is set on a resource, that resource cannot be deleted unless the lock is removed.</maml:para>
<maml:para>ReadOnly - When this level is set on a resource, that resource cannot updated or deleted unless the lock is removed.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">LockLevel</command:parameterValue>
</command:parameter>
Expand Down Expand Up @@ -3347,7 +3355,9 @@
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>LockLevel</maml:name>
<maml:description>
<maml:para>The level of the lock. The currently supported lock level is "CannotDelete". When this level is set on a resource, that resource cannont be deleted unless the lock is removed. </maml:para>
<maml:para>The level of the lock. The currently supported lock levels are "CannotDelete" and "ReadOnly". </maml:para>
<maml:para>CannotDelete - When this level is set on a resource, that resource cannot be deleted unless the lock is removed.</maml:para>
<maml:para>ReadOnly - When this level is set on a resource, that resource cannot updated or deleted unless the lock is removed.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">LockLevel</command:parameterValue>
</command:parameter>
Expand Down Expand Up @@ -3427,7 +3437,9 @@
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>LockLevel</maml:name>
<maml:description>
<maml:para>The level of the lock. The currently supported lock level is "CannotDelete". When this level is set on a resource, that resource cannont be deleted unless the lock is removed.</maml:para>
<maml:para>The level of the lock. The currently supported lock levels are "CannotDelete" and "ReadOnly". </maml:para>
<maml:para>CannotDelete - When this level is set on a resource, that resource cannot be deleted unless the lock is removed.</maml:para>
<maml:para>ReadOnly - When this level is set on a resource, that resource cannot updated or deleted unless the lock is removed.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">LockLevel</command:parameterValue>
</command:parameter>
Expand Down Expand Up @@ -3514,7 +3526,9 @@
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>LockLevel</maml:name>
<maml:description>
<maml:para>TThe level of the lock. The currently supported lock level is "CannotDelete". When this level is set on a resource, that resource cannont be deleted unless the lock is removed. </maml:para>
<maml:para>The level of the lock. The currently supported lock levels are "CannotDelete" and "ReadOnly". </maml:para>
<maml:para>CannotDelete - When this level is set on a resource, that resource cannot be deleted unless the lock is removed.</maml:para>
<maml:para>ReadOnly - When this level is set on a resource, that resource cannot updated or deleted unless the lock is removed.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">LockLevel</command:parameterValue>
<dev:type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,13 @@ function Test-ResourceLockCRUD
$removed = Remove-AzureRMResourceLock -ResourceId $actual.ResourceId -Force
Assert-AreEqual True $removed

#ReadOnly lock
$actual = New-AzureRMResourceLock -LockName $rname -LockLevel ReadOnly -Force -Scope $rg.ResourceId
Assert-AreEqual $expected.Name $actual.Name

$expected = Get-AzureRMResourceLock -LockName $rname -Scope $rg.ResourceId
Assert-AreEqual $expected.Properties.Level "ReadOnly"

$removed = Remove-AzureRMResourceLock -ResourceId $actual.ResourceId -Force
Assert-AreEqual True $removed
}
Loading