Skip to content

Add resource name completer to Network #7583

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 6 commits into from
Oct 16, 2018
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 @@ -29,6 +29,7 @@ public class GetAzureApplicationGatewayBackendHealthCommand : ApplicationGateway
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/applicationGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public virtual string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class GetAzureApplicationGatewayCommand : ApplicationGatewayBaseCmdlet
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/applicationGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public virtual string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class RemoveAzureApplicationGatewayCommand : ApplicationGatewayBaseCmdlet
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/applicationGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public virtual string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.Network.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.Network.Models;
using Microsoft.Rest.Azure;
Expand All @@ -30,6 +31,7 @@ public class GetAzureFirewallCommand : AzureFirewallBaseCmdlet
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/azureFirewalls", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public virtual string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ----------------------------------------------------------------------------------

using System.Management.Automation;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Network;

namespace Microsoft.Azure.Commands.Network
Expand All @@ -25,6 +26,7 @@ public class RemoveAzureFirewallCommand : AzureFirewallBaseCmdlet
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/azureFirewalls", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public virtual string Name { get; set; }

Expand Down
1 change: 1 addition & 0 deletions src/ResourceManager/Network/Commands.Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
--->
## Current Release
* Update cmdlet Test-AzureRmNetworkWatcherConnectivity, pass the protocol value to backend.
* Added ResourceName argument completer to all cmdlets.

## Version 6.9.0
* Added NetworkProfile functionality. new cmdlets added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class GetHubVirtualNetworkConnectionCommand : HubVnetConnectionBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVirtualHubName,
HelpMessage = "The parent resource name.")]
[ResourceGroupCompleter]
[ResourceNameCompleter("Microsoft.Network/virtualHubs", "ResourceGroupName")]
public string ParentResourceName { get; set; }

[Alias("VirtualHub", "ParentVirtualHub")]
Expand All @@ -65,6 +65,7 @@ public class GetHubVirtualNetworkConnectionCommand : HubVnetConnectionBaseCmdlet
[Parameter(
Mandatory = false,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/virtualHubs/hubVirtualNetworkConnections", "ResourceGroupName", "ParentResourceName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class NewHubVirtualNetworkConnectionCommand : HubVnetConnectionBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVirtualHubName + CortexParameterSetNames.ByRemoteVirtualNetworkObject,
HelpMessage = "The resource group name.")]
[ResourceNameCompleter("Microsoft.Network/virtualHubs", "ResourceGroupName")]
public string ParentResourceName { get; set; }

[Alias("VirtualHub", "ParentVirtualHub")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ public class RemoveHubVirtualNetworkConnectionCommand : HubVnetConnectionBaseCmd
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByHubVirtualNetworkConnectionName,
HelpMessage = "The parent resource name.")]
[ResourceNameCompleter("Microsoft.Network/virtualHubs", "ResourceGroupName")]
public string ParentResourceName { get; set; }

[Alias("ResourceName", "HubVirtualNetworkConnectionName")]
[Parameter(
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByHubVirtualNetworkConnectionName,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/virtualHubs/hubVirtualNetworkConnections", "ResourceGroupName", "ParentResourceName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class GetAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
Mandatory = false,
ParameterSetName = "ListByResourceGroupName",
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/virtualHubs", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class RemoveAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVirtualHubName,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/virtualHubs", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class UpdateAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVirtualHubName,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/virtualHubs", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class GetAzureRmVirtualWanCommand : VirtualWanBaseCmdlet
Mandatory = false,
ParameterSetName = "ListByResourceGroupName",
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/virtualWans", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class GetAzureRmVirtualWanVpnSitesConfigurationCommand : VirtualWanBaseCm
ParameterSetName = CortexParameterSetNames.ByVirtualWanName + CortexParameterSetNames.ByVpnSiteResourceId,
Mandatory = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/virtualWans", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class RemoveAzureRmVirtualWanCommand : VirtualWanBaseCmdlet
ParameterSetName = CortexParameterSetNames.ByVirtualWanName,
Mandatory = true,
HelpMessage = "The virtual wan name.")]
[ResourceNameCompleter("Microsoft.Network/virtualWans", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class UpdateAzureRmVirtualWanCommand : VirtualWanBaseCmdlet
ParameterSetName = CortexParameterSetNames.ByVirtualWanName,
Mandatory = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/virtualWans", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class GetAzureRmVpnConnectionCommand : VpnConnectionBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVpnGatewayName,
HelpMessage = "The parent resource name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string ParentResourceName { get; set; }

Expand All @@ -74,6 +75,7 @@ public class GetAzureRmVpnConnectionCommand : VpnConnectionBaseCmdlet
[Parameter(
Mandatory = false,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways/vpnConnections", "ResourceGroupName", "ParentResourceName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class NewAzureRmVpnConnectionCommand : VpnConnectionBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVpnGatewayName + CortexParameterSetNames.ByVpnSiteResourceId,
HelpMessage = "The resource group name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string ParentResourceName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class RemoveVpnConnectionCommand : VpnConnectionBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVpnConnectionName,
HelpMessage = "The parent resource name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string ParentResourceName { get; set; }

Expand All @@ -57,6 +58,7 @@ public class RemoveVpnConnectionCommand : VpnConnectionBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVpnConnectionName,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways/vpnConnections", "ResourceGroupName", "ParentResourceName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class UpdateAzureRmVpnConnectionCommand : VpnConnectionBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVpnConnectionName,
HelpMessage = "The parent resource name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string ParentResourceName { get; set; }

Expand All @@ -57,6 +58,7 @@ public class UpdateAzureRmVpnConnectionCommand : VpnConnectionBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVpnConnectionName,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways/vpnConnections", "ResourceGroupName", "ParentResourceName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class GetAzureRmVpnGatewayCommand : VpnGatewayBaseCmdlet
Mandatory = false,
ParameterSetName = "ListByResourceGroupName",
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class RemoveAzureRmVpnGatewayCommand : VpnGatewayBaseCmdlet
ParameterSetName = CortexParameterSetNames.ByVpnGatewayName,
Mandatory = true,
HelpMessage = "The vpnGateway name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class UpdateAzureRmVpnGatewayCommand : VpnGatewayBaseCmdlet
ParameterSetName = CortexParameterSetNames.ByVpnGatewayName,
Mandatory = true,
HelpMessage = "The virtual wan name.")]
[ResourceNameCompleter("Microsoft.Network/vpnGateways", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class GetAzureRmVpnSiteCommand : VpnSiteBaseCmdlet
Mandatory = false,
ParameterSetName = "ListByResourceGroupName",
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/vpnSites", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ public class NewAzureRmVpnSiteCommand : VpnSiteBaseCmdlet
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVirtualWanName,
HelpMessage = "The resource group name of the VirtualWan this VpnSite needs to be connected to.")]
[ResourceGroupCompleter]
public string VirtualWanResourceGroupName { get; set; }

[Parameter(
Mandatory = true,
ParameterSetName = CortexParameterSetNames.ByVirtualWanName,
HelpMessage = "The name of the VirtualWan this VpnSite needs to be connected to.")]
[ResourceNameCompleter("Microsoft.Network/virtualWans", "VirtualWanResourceGroupName")]
public string VirtualWanName { get; set; }

[Parameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class RemoveAzureRmVpnSiteCommand : VpnSiteBaseCmdlet
ParameterSetName = CortexParameterSetNames.ByVpnSiteName,
Mandatory = true,
HelpMessage = "The vpnSite name.")]
[ResourceNameCompleter("Microsoft.Network/vpnSites", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class UpdateAzureRmVpnSiteCommand : VpnSiteBaseCmdlet
ParameterSetName = CortexParameterSetNames.ByVpnSiteName + "NoVirtualWanUpdate",
Mandatory = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/vpnSites", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public partial class GetAzureRmDdosProtectionPlan : NetworkBaseCmdlet
Mandatory = true,
HelpMessage = "Specifies the name of the DDoS protection plan.",
ValueFromPipelineByPropertyName = true)]
[ResourceNameCompleter("Microsoft.Network/ddosProtectionPlans", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public partial class RemoveAzureRmDdosProtectionPlan : NetworkBaseCmdlet
Mandatory = true,
HelpMessage = "Specifies the name of the DDoS protection plan to be removed.",
ValueFromPipelineByPropertyName = true)]
[ResourceNameCompleter("Microsoft.Network/ddosProtectionPlans", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class GetAzureExpressRouteCircuitCommand : ExpressRouteCircuitBaseCmdlet
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCircuits", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public virtual string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class MoveAzureExpressRouteCircuitCommand : ExpressRouteCircuitBaseCmdlet
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCircuits", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public virtual string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class RemoveAzureExpressRouteCircuitCommand : ExpressRouteCircuitBaseCmdl
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource name.")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCircuits", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public virtual string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public class GetAzureExpressRouteCircuitARPTableCommand : NetworkBaseCmdlet
[Parameter(
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Name of ExpressRoute Circuit")]
[ValidateNotNullOrEmpty]
HelpMessage = "The Name of ExpressRoute Circuit")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCircuits", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string ExpressRouteCircuitName { get; set; }

[Parameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public class GetAzureRmExpressRouteCircuitRouteTable : NetworkBaseCmdlet
[Parameter(
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Name of ExpressRoute Circuit")]
[ValidateNotNullOrEmpty]
HelpMessage = "The Name of ExpressRoute Circuit")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCircuits", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string ExpressRouteCircuitName { get; set; }

[Parameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class GetAzureRmExpressRouteCircuitRouteTableSummaryCommand : NetworkBase
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Name of ExpressRoute Circuit")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCircuits", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string ExpressRouteCircuitName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public class GetAzureExpressRouteCircuitStatsCommand : NetworkBaseCmdlet
[Parameter(
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Name of ExpressRoute Circuit")]
HelpMessage = "The Name of ExpressRoute Circuit")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCircuits", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string ExpressRouteCircuitName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class GetAzureRMExpressRouteCrossConnectionArpTableCommand : ExpressRoute
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Name of Express Route Cross Connection",
ParameterSetName = "SpecifyByParameterValues")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCrossConnections", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string CrossConnectionName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class GetAzureRMExpressRouteCrossConnectionRouteTableCommand : ExpressRou
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Name of Express Route Cross Connection",
ParameterSetName = "SpecifyByParameterValues")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCrossConnections", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string CrossConnectionName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class GetAzureRMExpressRouteCrossConnectionRouteTableSummaryCommand : Exp
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Name of Express Route Cross Connection",
ParameterSetName = "SpecifyByParameterValues")]
[ResourceNameCompleter("Microsoft.Network/expressRouteCrossConnections", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string CrossConnectionName { get; set; }

Expand Down
Loading