Skip to content

Ensure cmdlet signature for Resources and Websites #1489

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 7 commits into from
Dec 15, 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
2 changes: 2 additions & 0 deletions src/CLU/Commands.ResourceManager.Cmdlets/Content/rename.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
new: create
ResourceGroup: group
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
public class FindAzureResourceGroupCmdlet : ResourceManagerCmdletBase
{
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The tag filter for the OData query. The expected format is @{Name = 'tagName'} or @{Name = 'tagName'; Value = 'tagValue'}.")]
[Alias("t")]
public Hashtable Tag { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,25 @@ public class GetAzureResourceGroupDeploymentOperationCmdlet : ResourceManagerCmd
/// <summary>
/// Gets or sets the resource group name parameter.
/// </summary>
[Alias("Name")]
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The deployment name.")]
[ValidateNotNullOrEmpty]
[Alias("Name","n")]
public string DeploymentName { get; set; }

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

/// <summary>
/// Gets or sets the resource group name parameter.
/// </summary>
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")]
[ValidateNotNullOrEmpty]
[Alias("group", "g")]
public string ResourceGroupName { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ public sealed class InvokAzureResourceActionCmdlet : ResourceManipulationCmdletB
/// <summary>
/// Gets or sets the property object.
/// </summary>
[Alias("Object")]
[Parameter(Mandatory = false, HelpMessage = "A hash table which represents resource properties.")]
[ValidateNotNullOrEmpty]
[Alias("Object")]
public Hashtable Parameters { get; set; }

/// <summary>
/// Gets or sets the property object.
/// </summary>
[Alias("ActionName")]
[Parameter(Mandatory = true, HelpMessage = "The name of the action to invoke.")]
[ValidateNotNullOrEmpty]
[Alias("ActionName","a")]
public string Action { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ public class GetAzureResourceLockCmdlet : ResourceLockManagementCmdletBase
/// <summary>
/// Gets or sets the extension resource name parameter.
/// </summary>
[Alias("ExtensionResourceName")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[ValidateNotNullOrEmpty]
[Alias("ExtensionResourceName", "name", "n")]
public string LockName { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public class NewAzureResourceLockCmdlet : ResourceLockManagementCmdletBase
/// <summary>
/// Gets or sets the extension resource name parameter.
/// </summary>
[Alias("ExtensionResourceName")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[ValidateNotNullOrEmpty]
[Alias("ExtensionResourceName", "name", "n")]
public string LockName { get; set; }

/// <summary>
Expand All @@ -58,6 +58,7 @@ public class NewAzureResourceLockCmdlet : ResourceLockManagementCmdletBase
/// Gets or sets the force parameter.
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "Do not ask for confirmation.")]
[Alias("f")]
public SwitchParameter Force { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@ public class RemoveAzureResourceLockCmdlet : ResourceLockManagementCmdletBase
/// <summary>
/// Gets or sets the extension resource name parameter.
/// </summary>
[Alias("ExtensionResourceName")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")]
[ValidateNotNullOrEmpty]
[Alias("ExtensionResourceName", "name", "n")]
public string LockName { get; set; }

/// <summary>
/// Gets or sets the force parameter.
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "Do not ask for confirmation.")]
[Alias("f")]
public SwitchParameter Force { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public abstract class ResourceLockManagementCmdletBase : ResourceManagerCmdletBa
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")]
[ValidateNotNullOrEmpty]
[Alias("name", "n")]
public string ResourceName { get; set; }

/// <summary>
Expand All @@ -86,6 +87,7 @@ public abstract class ResourceLockManagementCmdletBase : ResourceManagerCmdletBa
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
[ValidateNotNullOrEmpty]
[Alias("type", "t")]
public string ResourceType { get; set; }

/// <summary>
Expand All @@ -94,6 +96,7 @@ public abstract class ResourceLockManagementCmdletBase : ResourceManagerCmdletBa
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")]
[ValidateNotNullOrEmpty]
[Alias("group", "g")]
public string ResourceGroupName { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class GetAzurePolicyAssignmentCmdlet : PolicyAssignmentCmdletBase
/// </summary>
[Parameter(ParameterSetName = GetAzurePolicyAssignmentCmdlet.PolicyAssignmentNameParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The policy assignment name.")]
[ValidateNotNullOrEmpty]
[Alias("n")]
public string Name { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class GetAzurePolicyDefinitionCmdlet : PolicyDefinitionCmdletBase
/// </summary>
[Parameter(ParameterSetName = GetAzurePolicyDefinitionCmdlet.PolicyDefinitionNameParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The policy definition name.")]
[ValidateNotNullOrEmpty]
[Alias("n")]
public string Name { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class NewAzurePolicyAssignmentCmdlet : PolicyAssignmentCmdletBase
/// </summary>
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The policy assignment name.")]
[ValidateNotNullOrEmpty]
[Alias("n")]
public string Name { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class NewAzurePolicyDefinitionCmdlet : PolicyDefinitionCmdletBase
/// </summary>
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The policy definition name.")]
[ValidateNotNullOrEmpty]
[Alias("n")]
public string Name { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class RemoveAzurePolicyAssignmentCmdlet : PolicyAssignmentCmdletBase
/// </summary>
[Parameter(ParameterSetName = RemoveAzurePolicyAssignmentCmdlet.PolicyAssignmentNameParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The policy assignment name.")]
[ValidateNotNullOrEmpty]
[Alias("n")]
public string Name { get; set; }

/// <summary>
Expand All @@ -59,6 +60,7 @@ public class RemoveAzurePolicyAssignmentCmdlet : PolicyAssignmentCmdletBase
/// Gets or sets the force parameter.
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "Do not ask for confirmation.")]
[Alias("f")]
public SwitchParameter Force { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class RemoveAzurePolicyDefinitionCmdlet : PolicyDefinitionCmdletBase
/// </summary>
[Parameter(ParameterSetName = RemoveAzurePolicyDefinitionCmdlet.PolicyDefinitionNameParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The policy definition name.")]
[ValidateNotNullOrEmpty]
[Alias("n")]
public string Name { get; set; }

/// <summary>
Expand All @@ -52,6 +53,7 @@ public class RemoveAzurePolicyDefinitionCmdlet : PolicyDefinitionCmdletBase
/// Gets or sets the force parameter.
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "Do not ask for confirmation.")]
[Alias("f")]
public SwitchParameter Force { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class SetAzurePolicyAssignmentCmdlet : PolicyAssignmentCmdletBase
/// </summary>
[Parameter(ParameterSetName = SetAzurePolicyAssignmentCmdlet.PolicyAssignmentNameParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The policy assignment name.")]
[ValidateNotNullOrEmpty]
[Alias("n")]
public string Name { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class SetAzurePolicyDefinitionCmdlet : PolicyDefinitionCmdletBase
/// </summary>
[Parameter(ParameterSetName = GetAzurePolicyDefinitionCmdlet.PolicyDefinitionNameParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The policy definition name.")]
[ValidateNotNullOrEmpty]
[Alias("n")]
public string Name { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public sealed class FindAzureResourceCmdlet : ResourceManagerCmdletBase
/// <summary>
/// Gets or sets the resource name parameter.
/// </summary>
[Alias("Name")]
[Parameter(ParameterSetName = FindAzureResourceCmdlet.ListResourcesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name substring. e.g. if your resource name is testResource, you can specify test.")]
[Parameter(ParameterSetName = FindAzureResourceCmdlet.ListTenantResourcesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name substring. e.g. if your resource name is testResource, you can specify test.")]
[Parameter(ParameterSetName = FindAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name substring. e.g. if your resource name is testResource, you can specify test.")]
[ValidateNotNullOrEmpty]
[Alias("Name", "n")]
public string ResourceNameContains { get; set; }

/// <summary>
Expand All @@ -74,6 +74,7 @@ public sealed class FindAzureResourceCmdlet : ResourceManagerCmdletBase
[Parameter(ParameterSetName = FindAzureResourceCmdlet.ListTenantResourcesParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
[Parameter(ParameterSetName = FindAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
[ValidateNotNullOrEmpty]
[Alias("type","t")]
public string ResourceType { get; set; }

/// <summary>
Expand Down Expand Up @@ -120,10 +121,10 @@ public sealed class FindAzureResourceCmdlet : ResourceManagerCmdletBase
/// <summary>
/// Gets or sets the resource group name.
/// </summary>
[Alias("ResourceGroupName")]
[Parameter(Mandatory = false, ParameterSetName = FindAzureResourceCmdlet.ListResourcesParameterSet, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name substring.")]
[Parameter(Mandatory = false, ParameterSetName = FindAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name substring.")]
[ValidateNotNullOrEmpty]
[Alias("ResourceGroupName", "group", "g")]
public string ResourceGroupNameContains { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public sealed class GetAzureResourceCmdlet : ResourceManagerCmdletBase
[Parameter(ParameterSetName = GetAzureResourceCmdlet.GetResourceByNameTypeParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
[Parameter(ParameterSetName = GetAzureResourceCmdlet.GetResourceByNameGroupTypeParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
[ValidateNotNullOrEmpty]
[Alias("type", "t")]
public string ResourceType { get; set; }

/// <summary>
Expand Down Expand Up @@ -165,6 +166,7 @@ public sealed class GetAzureResourceCmdlet : ResourceManagerCmdletBase
[Parameter(ParameterSetName = GetAzureResourceCmdlet.GetResourceByNameGroupParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")]
[Parameter(ParameterSetName = GetAzureResourceCmdlet.GetResourceByNameGroupTypeParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")]
[ValidateNotNullOrEmpty]
[Alias("group", "g")]
public string ResourceGroupName { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class MoveAzureResourceCommand : ResourceManagerCmdletBase
[Parameter(Mandatory = true,
HelpMessage = "The name of the resource group into which the resources are to be moved.")]
[ValidateNotNullOrEmpty]
[Alias("TargetResourceGroup")]
[Alias("TargetResourceGroup", "destination", "target", "group", "g")]
public string DestinationResourceGroupName { get; set; }

/// <summary>
Expand All @@ -50,13 +50,14 @@ public class MoveAzureResourceCommand : ResourceManagerCmdletBase
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "The Id of the subscription to move the resources into.")]
[ValidateNotNullOrEmpty]
[Alias("Id", "SubscriptionId")]
[Alias("Id", "SubscriptionId", "s")]
public Guid? DestinationSubscriptionId { get; set; }

/// <summary>
/// Gets or sets a value that indicates if the user should be prompted for confirmation.
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "Do not ask for confirmation.")]
[Alias("f")]
public SwitchParameter Force { get; set; }

/// <summary>
Expand Down
Loading