From 4dfbe273cdf8d88076fd5624122a795a6e0fa80a Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Fri, 15 Jul 2022 16:18:22 -0700 Subject: [PATCH 01/28] updated readme --- src/NetworkFunction/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetworkFunction/README.md b/src/NetworkFunction/README.md index 788177a26ba1..35e5936866cc 100644 --- a/src/NetworkFunction/README.md +++ b/src/NetworkFunction/README.md @@ -41,6 +41,6 @@ directive: variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ hide: true - where: - verb: Set + subject: ^Operation$ hide: true ``` \ No newline at end of file From db5b027942dc2807dd60c02dbea95d9369c4cbf5 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Mon, 18 Jul 2022 13:49:24 -0700 Subject: [PATCH 02/28] Added custom script for get traffic collector --- src/NetworkFunction/README.md | 9 +- ...AzNetworkFunctionAzureTrafficCollector.ps1 | 200 +++++++++ ...tworkFunctionAzureTrafficCollector_List.cs | 404 ++++++++++++++++++ .../New-AzNetworkFunctionCollectorPolicy.ps1 | 142 ++++++ 4 files changed, 754 insertions(+), 1 deletion(-) create mode 100644 src/NetworkFunction/custom/Get-AzNetworkFunctionAzureTrafficCollector.ps1 create mode 100644 src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs create mode 100644 src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 diff --git a/src/NetworkFunction/README.md b/src/NetworkFunction/README.md index 35e5936866cc..be90d58e6c03 100644 --- a/src/NetworkFunction/README.md +++ b/src/NetworkFunction/README.md @@ -41,6 +41,13 @@ directive: variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ hide: true - where: - subject: ^Operation$ + subject: (.)*(ByResourceGroup)$ hide: true + - where: + subject: (.)*(BySubscription)$ + hide: true + - where: + subject: (.)*(Operation)$ + hide: true + ``` \ No newline at end of file diff --git a/src/NetworkFunction/custom/Get-AzNetworkFunctionAzureTrafficCollector.ps1 b/src/NetworkFunction/custom/Get-AzNetworkFunctionAzureTrafficCollector.ps1 new file mode 100644 index 000000000000..b8d469130f5c --- /dev/null +++ b/src/NetworkFunction/custom/Get-AzNetworkFunctionAzureTrafficCollector.ps1 @@ -0,0 +1,200 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the specified Azure Traffic Collector in a specified resource group +.Description +Gets the specified Azure Traffic Collector in a specified resource group +.Example +{{ Add code here }} +.Example +{{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector +.Notes +COMPLEX PARAMETER PROPERTIES +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +INPUTOBJECT : Identity Parameter + [AzureTrafficCollectorName ]: Azure Traffic Collector name + [CollectorPolicyName ]: Collector Policy Name + [Id ]: Resource identity path + [ResourceGroupName ]: The name of the resource group. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctionazuretrafficcollector +#> +function Get-AzNetworkFunctionAzureTrafficCollector { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector])] + [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] + param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AzureTrafficCollectorName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_Get'; + GetViaIdentity = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_GetViaIdentity'; + List = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + } + + process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + + } + end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + } + } \ No newline at end of file diff --git a/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs b/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs new file mode 100644 index 000000000000..9242f8c40258 --- /dev/null +++ b/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; + using System; + + /// Return list of Azure Traffic Collectors in a Resource Group + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkFunctionTrafficCollector_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Return list of Azure Traffic Collectors in a Resource Group")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + public partial class GetAzNetworkFunctionAzureTrafficCollector_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.NetworkFunction Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the resource group.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Azure Subscription ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzNetworkFunctionAzureTrafficCollector_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AzureTrafficCollectorsByResourceGroupList(ResourceGroupName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AzureTrafficCollectorsByResourceGroupList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 new file mode 100644 index 000000000000..d779fca27cd4 --- /dev/null +++ b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 @@ -0,0 +1,142 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the specified Azure Traffic Collector in a specified resource group +.Description +Gets the specified Azure Traffic Collector in a specified resource group +.Example +{{ Add code here }} +.Example +{{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector +.Notes +COMPLEX PARAMETER PROPERTIES +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +INPUTOBJECT : Identity Parameter + [AzureTrafficCollectorName ]: Azure Traffic Collector name + [CollectorPolicyName ]: Collector Policy Name + [Id ]: Resource identity path + [ResourceGroupName ]: The name of the resource group. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctionazuretrafficcollector +#> +function Get-AzNetworkFunctionAzureTrafficCollector { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get')] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +process { + try { + $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ + Get = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_Get'; + GetViaIdentity = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_GetViaIdentity'; + List = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} +} \ No newline at end of file From bb8f081ad3948d7b6aef6045d8350aab4278b825 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Mon, 18 Jul 2022 14:29:43 -0700 Subject: [PATCH 03/28] readme indentation --- src/NetworkFunction/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NetworkFunction/README.md b/src/NetworkFunction/README.md index be90d58e6c03..c611764e781f 100644 --- a/src/NetworkFunction/README.md +++ b/src/NetworkFunction/README.md @@ -44,10 +44,10 @@ directive: subject: (.)*(ByResourceGroup)$ hide: true - where: - subject: (.)*(BySubscription)$ + subject: (.)*(BySubscription)$ hide: true - where: - subject: (.)*(Operation)$ + subject: (.)*(Operation)$ hide: true ``` \ No newline at end of file From d0f68f879aa3f29f152ec29f1ee3169c92acf848 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Mon, 18 Jul 2022 14:58:07 -0700 Subject: [PATCH 04/28] resolving compile issues --- ...etworkFunctionAzureTrafficCollector_List.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs b/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs index 9242f8c40258..634616c252d0 100644 --- a/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs +++ b/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs @@ -33,6 +33,12 @@ public partial class GetAzNetworkFunctionAzureTrafficCollector_List : global::Sy /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] @@ -301,7 +307,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -347,14 +353,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -364,12 +370,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollectorListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -393,7 +399,7 @@ protected override void StopProcessing() if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Runtime.Method.Get ); - await ((Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await this.Client.AzureTrafficCollectorsByResourceGroupList_Call(requestMessage, onOk, onDefault, this, Pipeline); } } From f0ebf4d6ed14897e8ed444d52029562521b5fccc Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Mon, 18 Jul 2022 15:13:17 -0700 Subject: [PATCH 05/28] resolving compile issues --- .../GetAzNetworkFunctionAzureTrafficCollector_List.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs b/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs index 634616c252d0..3d6e2a733b61 100644 --- a/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs +++ b/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs @@ -149,12 +149,12 @@ public partial class GetAzNetworkFunctionAzureTrafficCollector_List : global::Sy /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollectorListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -370,7 +370,7 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollectorListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollectorListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. @@ -387,7 +387,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollectorListResult var result = await response; WriteObject(result.Value,true); _nextLink = result.NextLink; @@ -398,7 +398,7 @@ protected override void StopProcessing() { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { - requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Runtime.Method.Get ); + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Method.Get ); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await this.Client.AzureTrafficCollectorsByResourceGroupList_Call(requestMessage, onOk, onDefault, this, Pipeline); } From 31f160c288218e6cb0376590438cd7fad4872b32 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Mon, 18 Jul 2022 15:28:44 -0700 Subject: [PATCH 06/28] removed extra file --- .../New-AzNetworkFunctionCollectorPolicy.ps1 | 142 ------------------ 1 file changed, 142 deletions(-) delete mode 100644 src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 deleted file mode 100644 index d779fca27cd4..000000000000 --- a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 +++ /dev/null @@ -1,142 +0,0 @@ -# ---------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code -# is regenerated. -# ---------------------------------------------------------------------------------- - -<# -.Synopsis -Gets the specified Azure Traffic Collector in a specified resource group -.Description -Gets the specified Azure Traffic Collector in a specified resource group -.Example -{{ Add code here }} -.Example -{{ Add code here }} -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector -.Notes -COMPLEX PARAMETER PROPERTIES -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter - [AzureTrafficCollectorName ]: Azure Traffic Collector name - [CollectorPolicyName ]: Collector Policy Name - [Id ]: Resource identity path - [ResourceGroupName ]: The name of the resource group. - [SubscriptionId ]: Azure Subscription ID. -.Link -https://docs.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctionazuretrafficcollector -#> -function Get-AzNetworkFunctionAzureTrafficCollector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Azure Traffic Collector name - ${Name}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # The name of the resource group. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter(ParameterSetName='Get')] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] - [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. - ${DefaultProfile}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -process { - try { - $parameterSet = $PSCmdlet.ParameterSetName - $mapping = @{ - Get = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_Get'; - GetViaIdentity = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_GetViaIdentity'; - List = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - throw - } -} -} \ No newline at end of file From ba7e6fab488f265b8d74044863e4265046138113 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Tue, 19 Jul 2022 08:09:18 -0700 Subject: [PATCH 07/28] renamed file --- src/NetworkFunction/README.md | 4 + ...AzNetworkFunctionAzureTrafficCollector.ps1 | 200 ------------------ ...AzNetworkFunctionTrafficCollector_List.cs} | 6 +- 3 files changed, 7 insertions(+), 203 deletions(-) delete mode 100644 src/NetworkFunction/custom/Get-AzNetworkFunctionAzureTrafficCollector.ps1 rename src/NetworkFunction/custom/{GetAzNetworkFunctionAzureTrafficCollector_List.cs => GetAzNetworkFunctionTrafficCollector_List.cs} (99%) diff --git a/src/NetworkFunction/README.md b/src/NetworkFunction/README.md index c611764e781f..3e3a43870ebf 100644 --- a/src/NetworkFunction/README.md +++ b/src/NetworkFunction/README.md @@ -37,6 +37,10 @@ resourcegroup-append: true nested-object-to-string: true directive: + - where: + subject: ^AzureTrafficCollector(.*) + set: + subject: TrafficCollector$1 - where: variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ hide: true diff --git a/src/NetworkFunction/custom/Get-AzNetworkFunctionAzureTrafficCollector.ps1 b/src/NetworkFunction/custom/Get-AzNetworkFunctionAzureTrafficCollector.ps1 deleted file mode 100644 index b8d469130f5c..000000000000 --- a/src/NetworkFunction/custom/Get-AzNetworkFunctionAzureTrafficCollector.ps1 +++ /dev/null @@ -1,200 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code -# is regenerated. -# ---------------------------------------------------------------------------------- - -<# -.Synopsis -Gets the specified Azure Traffic Collector in a specified resource group -.Description -Gets the specified Azure Traffic Collector in a specified resource group -.Example -{{ Add code here }} -.Example -{{ Add code here }} -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector -.Notes -COMPLEX PARAMETER PROPERTIES -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter - [AzureTrafficCollectorName ]: Azure Traffic Collector name - [CollectorPolicyName ]: Collector Policy Name - [Id ]: Resource identity path - [ResourceGroupName ]: The name of the resource group. - [SubscriptionId ]: Azure Subscription ID. -.Link -https://docs.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctionazuretrafficcollector -#> -function Get-AzNetworkFunctionAzureTrafficCollector { - [OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector])] - [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] - param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('AzureTrafficCollectorName')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Azure Traffic Collector name - ${Name}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # The name of the resource group. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] - [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. - ${DefaultProfile}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} - ) - - begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - Get = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_Get'; - GetViaIdentity = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_GetViaIdentity'; - List = 'Az.NetworkFunction.private\Get-AzNetworkFunctionAzureTrafficCollector_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - } - - process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - - } - end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - } - } \ No newline at end of file diff --git a/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs b/src/NetworkFunction/custom/GetAzNetworkFunctionTrafficCollector_List.cs similarity index 99% rename from src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs rename to src/NetworkFunction/custom/GetAzNetworkFunctionTrafficCollector_List.cs index 3d6e2a733b61..e7816a73af6e 100644 --- a/src/NetworkFunction/custom/GetAzNetworkFunctionAzureTrafficCollector_List.cs +++ b/src/NetworkFunction/custom/GetAzNetworkFunctionTrafficCollector_List.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Return list of Azure Traffic Collectors in a Resource Group")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] - public partial class GetAzNetworkFunctionAzureTrafficCollector_List : global::System.Management.Automation.PSCmdlet, + public partial class GetAzNetworkFunctionTrafficCollector_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { /// A unique id generatd for the this cmdlet when it is instantiated. @@ -181,9 +181,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Intializes a new instance of the cmdlet class. /// - public GetAzNetworkFunctionAzureTrafficCollector_List() + public GetAzNetworkFunctionTrafficCollector_List() { } From 82e1aa6b7c848e26df4790a724d3d08b260d9a3e Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Tue, 19 Jul 2022 13:05:03 -0700 Subject: [PATCH 08/28] added new collector policy cmdlet --- .../Models/Api20220501/CollectorPolicy.cs | 269 +++++++++ ...kFunctionCollectorPolicy_CreateExpanded.cs | 536 ++++++++++++++++++ 2 files changed, 805 insertions(+) create mode 100644 src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs create mode 100644 src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs diff --git a/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs b/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs new file mode 100644 index 000000000000..c4e1573269c8 --- /dev/null +++ b/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; + + /// Collector policy resource. + public partial class CollectorPolicy : + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy, + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ProxyResource(); + + /// Emission policies. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[] EmissionPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).EmissionPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).EmissionPolicy = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _etag; + + /// A unique read-only string that changes whenever the resource is updated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Azure resource Id + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Id; } + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IResourceInternal)__resource).Location = value ?? null; } + + /// Ingestion Sources. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[] IngestionPolicyIngestionSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicyIngestionSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicyIngestionSource = value ?? null /* arrayOf */; } + + /// The ingestion type. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType? IngestionPolicyIngestionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicyIngestionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicyIngestionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType)""); } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for IngestionPolicy + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionPolicyPropertiesFormat Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.IngestionPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicy = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormat Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.CollectorPolicyPropertiesFormat()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Azure resource name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormat _property; + + /// Properties of the Collector Policy. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormat Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.CollectorPolicyPropertiesFormat()); set => this._property = value; } + + /// The provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType)""); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType)""); } + + /// Azure resource type + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public CollectorPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// Collector policy resource. + public partial interface ICollectorPolicy : + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResource + { + /// Location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"Location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set;} + /// Emission policies. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Emission policies.", + SerializedName = @"emissionPolicies", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[] EmissionPolicy { get; set; } + /// A unique read-only string that changes whenever the resource is updated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A unique read-only string that changes whenever the resource is updated.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// Ingestion Sources. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ingestion Sources.", + SerializedName = @"ingestionSources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[] IngestionPolicyIngestionSource { get; set; } + /// The ingestion type. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ingestion type.", + SerializedName = @"ingestionType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType? IngestionPolicyIngestionType { get; set; } + /// The provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState? ProvisioningState { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Collector policy resource. + internal partial interface ICollectorPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal + { + /// Emission policies. + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[] EmissionPolicy { get; set; } + /// A unique read-only string that changes whenever the resource is updated. + string Etag { get; set; } + /// Ingestion policies. + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionPolicyPropertiesFormat IngestionPolicy { get; set; } + /// Ingestion Sources. + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[] IngestionPolicyIngestionSource { get; set; } + /// The ingestion type. + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType? IngestionPolicyIngestionType { get; set; } + /// Properties of the Collector Policy. + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormat Property { get; set; } + /// The provisioning state. + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState? ProvisioningState { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// The location of Collection Policy in a Traffic Collector. + string Location { get; set; } + } +} \ No newline at end of file diff --git a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..cbd8124911e8 --- /dev/null +++ b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs @@ -0,0 +1,536 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; + using System; + + /// Creates or updates a Collector Policy resource + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkFunctionCollectorPolicy_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Collector Policy resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + public partial class NewAzNetworkFunctionCollectorPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Collector policy resource. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.CollectorPolicy(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _azureTrafficCollectorName; + + /// Azure Traffic Collector name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Traffic Collector name")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Traffic Collector name", + SerializedName = @"azureTrafficCollectorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] + public string AzureTrafficCollectorName { get => this._azureTrafficCollectorName; set => this._azureTrafficCollectorName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.NetworkFunction Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Resource location. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => ParametersBody.Location; set => ParametersBody.Location = value; } + + /// Emission policies. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Emission policies.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Emission policies.", + SerializedName = @"emissionPolicies", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[] EmissionPolicy { get => _parametersBody.EmissionPolicy ?? null /* arrayOf */; set => _parametersBody.EmissionPolicy = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Ingestion Sources. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ingestion Sources.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ingestion Sources.", + SerializedName = @"ingestionSources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[] IngestionPolicyIngestionSource { get => _parametersBody.IngestionPolicyIngestionSource ?? null /* arrayOf */; set => _parametersBody.IngestionPolicyIngestionSource = value; } + + /// The ingestion type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ingestion type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ingestion type.", + SerializedName = @"ingestionType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType))] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType IngestionPolicyIngestionType { get => _parametersBody.IngestionPolicyIngestionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType)""); set => _parametersBody.IngestionPolicyIngestionType = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Collector Policy Name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Collector Policy Name")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Collector Policy Name", + SerializedName = @"collectorPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CollectorPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Azure Subscription ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkFunctionCollectorPolicy_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets.NewAzNetworkFunctionCollectorPolicy_CreateExpanded Clone() + { + var clone = new NewAzNetworkFunctionCollectorPolicy_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SubscriptionId = this.SubscriptionId; + clone.AzureTrafficCollectorName = this.AzureTrafficCollectorName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzNetworkFunctionCollectorPolicy_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CollectorPoliciesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CollectorPoliciesCreateOrUpdate(ResourceGroupName, SubscriptionId, AzureTrafficCollectorName, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,AzureTrafficCollectorName=AzureTrafficCollectorName,Name=Name,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, AzureTrafficCollectorName=AzureTrafficCollectorName, Name=Name, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, AzureTrafficCollectorName=AzureTrafficCollectorName, Name=Name, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file From e4973944abff53eccb1d61b3f1dfdbe03e4e537b Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Tue, 19 Jul 2022 13:23:24 -0700 Subject: [PATCH 09/28] solving compile issues --- .../Models/Api20220501/CollectorPolicy.cs | 230 +----------------- 1 file changed, 1 insertion(+), 229 deletions(-) diff --git a/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs b/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs index c4e1573269c8..4f00b55bbfc9 100644 --- a/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs +++ b/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs @@ -13,130 +13,9 @@ public partial class CollectorPolicy : Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IValidates { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ProxyResource(); - - /// Emission policies. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[] EmissionPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).EmissionPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).EmissionPolicy = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string _etag; - - /// A unique read-only string that changes whenever the resource is updated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Azure resource Id - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Id; } - /// Resource location. - [Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IResourceInternal)__resource).Location = value ?? null; } - - /// Ingestion Sources. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[] IngestionPolicyIngestionSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicyIngestionSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicyIngestionSource = value ?? null /* arrayOf */; } - - /// The ingestion type. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType? IngestionPolicyIngestionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicyIngestionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicyIngestionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType)""); } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for IngestionPolicy - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionPolicyPropertiesFormat Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.IngestionPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).IngestionPolicy = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormat Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.CollectorPolicyPropertiesFormat()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.SystemData()); set { {_systemData = value;} } } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Name = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Type = value; } - - /// Azure resource name [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormat _property; - - /// Properties of the Collector Policy. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormat Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.CollectorPolicyPropertiesFormat()); set => this._property = value; } - - /// The provisioning state. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormatInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemData _systemData; - - /// Metadata pertaining to creation and last modification of the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.SystemData()); } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType)""); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType)""); } - - /// Azure resource type - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal)__proxyResource).Type; } - - /// Creates an new instance. - public CollectorPolicy() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); - await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); - } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IResourceInternal)__resource).Location = value ?? null; } } /// Collector policy resource. public partial interface ICollectorPolicy : @@ -151,118 +30,11 @@ public partial interface ICollectorPolicy : SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] string Location { get; set;} - /// Emission policies. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Emission policies.", - SerializedName = @"emissionPolicies", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[] EmissionPolicy { get; set; } - /// A unique read-only string that changes whenever the resource is updated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"A unique read-only string that changes whenever the resource is updated.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// Ingestion Sources. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Ingestion Sources.", - SerializedName = @"ingestionSources", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[] IngestionPolicyIngestionSource { get; set; } - /// The ingestion type. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The ingestion type.", - SerializedName = @"ingestionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType? IngestionPolicyIngestionType { get; set; } - /// The provisioning state. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState? ProvisioningState { get; } - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource creation (UTC).", - SerializedName = @"createdAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that created the resource.", - SerializedName = @"createdBy", - PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity that created the resource.", - SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataCreatedByType { get; set; } - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that last modified the resource.", - SerializedName = @"lastModifiedBy", - PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity that last modified the resource.", - SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } - } /// Collector policy resource. internal partial interface ICollectorPolicyInternal : Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal { - /// Emission policies. - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[] EmissionPolicy { get; set; } - /// A unique read-only string that changes whenever the resource is updated. - string Etag { get; set; } - /// Ingestion policies. - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionPolicyPropertiesFormat IngestionPolicy { get; set; } - /// Ingestion Sources. - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[] IngestionPolicyIngestionSource { get; set; } - /// The ingestion type. - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType? IngestionPolicyIngestionType { get; set; } - /// Properties of the Collector Policy. - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyPropertiesFormat Property { get; set; } - /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.ProvisioningState? ProvisioningState { get; set; } - /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ISystemData SystemData { get; set; } - /// The timestamp of resource creation (UTC). - global::System.DateTime? SystemDataCreatedAt { get; set; } - /// The identity that created the resource. - string SystemDataCreatedBy { get; set; } - /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataCreatedByType { get; set; } - /// The identity that last modified the resource. - string SystemDataLastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } /// The location of Collection Policy in a Traffic Collector. string Location { get; set; } } From 6253baaadf4ff5072cfb332450e244d0b9401bea Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Tue, 19 Jul 2022 13:43:57 -0700 Subject: [PATCH 10/28] solving compile issues --- ...kFunctionCollectorPolicy_CreateExpanded.cs | 503 ------------------ 1 file changed, 503 deletions(-) diff --git a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs index cbd8124911e8..c960e1dd1efa 100644 --- a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs +++ b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs @@ -19,59 +19,6 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets public partial class NewAzNetworkFunctionCollectorPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// Collector policy resource. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.CollectorPolicy(); - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// Backing field for property. - private string _azureTrafficCollectorName; - - /// Azure Traffic Collector name - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Traffic Collector name")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Azure Traffic Collector name", - SerializedName = @"azureTrafficCollectorName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] - public string AzureTrafficCollectorName { get => this._azureTrafficCollectorName; set => this._azureTrafficCollectorName = value; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.NetworkFunction Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.ClientAPI; - - /// - /// The credentials, account, tenant, and subscription used for communication with Azure - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - /// Resource location. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] @@ -82,455 +29,5 @@ public partial class NewAzNetworkFunctionCollectorPolicy_CreateExpanded : global SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] public string Location { get => ParametersBody.Location; set => ParametersBody.Location = value; } - - /// Emission policies. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Emission policies.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Emission policies.", - SerializedName = @"emissionPolicies", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[] EmissionPolicy { get => _parametersBody.EmissionPolicy ?? null /* arrayOf */; set => _parametersBody.EmissionPolicy = value; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } - - /// SendAsync Pipeline Steps to be prepended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Ingestion Sources. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ingestion Sources.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Ingestion Sources.", - SerializedName = @"ingestionSources", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[] IngestionPolicyIngestionSource { get => _parametersBody.IngestionPolicyIngestionSource ?? null /* arrayOf */; set => _parametersBody.IngestionPolicyIngestionSource = value; } - - /// The ingestion type. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ingestion type.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The ingestion type.", - SerializedName = @"ingestionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType IngestionPolicyIngestionType { get => _parametersBody.IngestionPolicyIngestionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType)""); set => _parametersBody.IngestionPolicyIngestionType = value; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// Collector Policy Name - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Collector Policy Name")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Collector Policy Name", - SerializedName = @"collectorPolicyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("CollectorPolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.HttpPipeline Pipeline { get; set; } - - /// The URI for the proxy server to use - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Uri Proxy { get; set; } - - /// Credentials for a proxy server to use for the remote call - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } - - /// Use the default credentials for the proxy - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Backing field for property. - private string _resourceGroupName; - - /// The name of the resource group. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group.")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _subscriptionId; - - /// Azure Subscription ID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Azure Subscription ID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] - public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICloudError - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzNetworkFunctionCollectorPolicy_CreateExpanded - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets.NewAzNetworkFunctionCollectorPolicy_CreateExpanded Clone() - { - var clone = new NewAzNetworkFunctionCollectorPolicy_CreateExpanded(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._parametersBody = this._parametersBody; - clone.ResourceGroupName = this.ResourceGroupName; - clone.SubscriptionId = this.SubscriptionId; - clone.AzureTrafficCollectorName = this.AzureTrafficCollectorName; - clone.Name = this.Name; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) - { - using( NoSynchronizationContext ) - { - if (token.IsCancellationRequested) - { - return ; - } - - switch ( id ) - { - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.DelayBeforePolling: - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - var data = messageData(); - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); - if (token.IsCancellationRequested) - { - return ; - } - WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); - } - } - - /// - /// Intializes a new instance of the cmdlet class. - /// - public NewAzNetworkFunctionCollectorPolicy_CreateExpanded() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CollectorPoliciesCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token); - } - } - } - } - catch (global::System.AggregateException aggregateException) - { - // unroll the inner exceptions to get the root cause - foreach( var innerException in aggregateException.Flatten().InnerExceptions ) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - // Write exception out to error channel. - WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); - } - } - catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - // Write exception out to error channel. - WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); - } - finally - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordEnd).Wait(); - } - } - - /// Performs execution of the command, working asynchronously if required. - /// - /// A that will be complete when handling of the method is completed. - /// - protected async global::System.Threading.Tasks.Task ProcessRecordAsync() - { - using( NoSynchronizationContext ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CollectorPoliciesCreateOrUpdate(ResourceGroupName, SubscriptionId, AzureTrafficCollectorName, Name, _parametersBody, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,AzureTrafficCollectorName=AzureTrafficCollectorName,Name=Name,body=_parametersBody}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICloudError - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, AzureTrafficCollectorName=AzureTrafficCollectorName, Name=Name, body=_parametersBody }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, AzureTrafficCollectorName=AzureTrafficCollectorName, Name=Name, body=_parametersBody }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnOk(responseMessage, response, ref _returnNow); - // if overrideOnOk has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy - WriteObject((await response)); - } - } } } \ No newline at end of file From e424ea6a859f163635cdd38da99aea60694b2aff Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Tue, 19 Jul 2022 13:55:25 -0700 Subject: [PATCH 11/28] solving compile issues --- .../NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs index c960e1dd1efa..17314e7b1311 100644 --- a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs +++ b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs @@ -12,10 +12,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkFunctionCollectorPolicy_CreateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Collector Policy resource")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] public partial class NewAzNetworkFunctionCollectorPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { From ce56968deaea9e37bb44052b2067785b3a151ad4 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Tue, 19 Jul 2022 15:04:41 -0700 Subject: [PATCH 12/28] added new ps script --- .../Models/Api20220501/CollectorPolicy.cs | 41 --- .../New-AzNetworkFunctionCollectorPolicy.ps1 | 235 ++++++++++++++++++ ...kFunctionCollectorPolicy_CreateExpanded.cs | 30 --- 3 files changed, 235 insertions(+), 71 deletions(-) delete mode 100644 src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs create mode 100644 src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 delete mode 100644 src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs diff --git a/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs b/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs deleted file mode 100644 index 4f00b55bbfc9..000000000000 --- a/src/NetworkFunction/custom/Models/Api20220501/CollectorPolicy.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; - - /// Collector policy resource. - public partial class CollectorPolicy : - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy, - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IValidates - { - /// Resource location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IResourceInternal)__resource).Location = value ?? null; } - } - /// Collector policy resource. - public partial interface ICollectorPolicy : - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResource - { - /// Location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = true, - ReadOnly = true, - Description = @"Location.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string Location { get; set;} - } - /// Collector policy resource. - internal partial interface ICollectorPolicyInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal - { - /// The location of Collection Policy in a Traffic Collector. - string Location { get; set; } - } -} \ No newline at end of file diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 new file mode 100644 index 000000000000..f1a877042bfa --- /dev/null +++ b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 @@ -0,0 +1,235 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a Collector Policy resource +.Description +Creates or updates a Collector Policy resource +.Example +{{ Add code here }} +.Example +{{ Add code here }} +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy +.Notes +COMPLEX PARAMETER PROPERTIES +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +EMISSIONPOLICY : Emission policies. + [EmissionDestination ]: Emission policy destinations. + [DestinationType ]: Emission destination type. + [EmissionType ]: Emission format type. +INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. + [ResourceId ]: Resource ID. + [SourceType ]: Ingestion source type. +.Link +https://docs.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy +#> +function New-AzNetworkFunctionCollectorPolicy { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy])] + [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${AzureTrafficCollectorName}, + + [Parameter(Mandatory)] + [Alias('CollectorPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Collector Policy Name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[]] + # Emission policies. + # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. + ${EmissionPolicy}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[]] + # Ingestion Sources. + # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. + ${IngestionPolicyIngestionSource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType] + # The ingestion type. + ${IngestionPolicyIngestionType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + } + + process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + + } + end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + } + } \ No newline at end of file diff --git a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs deleted file mode 100644 index 17314e7b1311..000000000000 --- a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; - using System; - - /// Creates or updates a Collector Policy resource - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}" - /// - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy))] - public partial class NewAzNetworkFunctionCollectorPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener - { - /// Resource location. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Resource location.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - public string Location { get => ParametersBody.Location; set => ParametersBody.Location = value; } - } -} \ No newline at end of file From 3cd1cf92297bd313524c8f2981556e109b78be2c Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Tue, 19 Jul 2022 15:23:49 -0700 Subject: [PATCH 13/28] added new ps script --- .../custom/New-AzNetworkFunctionCollectorPolicy.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 index f1a877042bfa..f895cef6a284 100644 --- a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 @@ -181,10 +181,7 @@ function New-AzNetworkFunctionCollectorPolicy { } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } - - $mapping = @{ - CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateExpanded'; - } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } From 830260183e0a251431474f673683f5bdb0dab52a Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Wed, 20 Jul 2022 15:08:30 -0700 Subject: [PATCH 14/28] New cmdlet csharp script --- .../custom/Models/CollectorPolicy.cs | 41 ++++ .../New-AzNetworkFunctionCollectorPolicy.ps1 | 232 ------------------ ...kFunctionCollectorPolicy_CreateExpanded.cs | 30 +++ 3 files changed, 71 insertions(+), 232 deletions(-) create mode 100644 src/NetworkFunction/custom/Models/CollectorPolicy.cs delete mode 100644 src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 create mode 100644 src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs diff --git a/src/NetworkFunction/custom/Models/CollectorPolicy.cs b/src/NetworkFunction/custom/Models/CollectorPolicy.cs new file mode 100644 index 000000000000..033a9a00d356 --- /dev/null +++ b/src/NetworkFunction/custom/Models/CollectorPolicy.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; + + /// Collector policy resource. + public partial class CollectorPolicy : + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy, + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IValidates + { + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResourceInternal)__resource).Location = value ?? null; } + } + /// Collector policy resource. + public partial interface ICollectorPolicy : + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResource + { + /// Location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"Location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set;} + } + /// Collector policy resource. + internal partial interface ICollectorPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal + { + /// The location of Collection Policy in a Traffic Collector. + string Location { get; set; } + } +} \ No newline at end of file diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 deleted file mode 100644 index f895cef6a284..000000000000 --- a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 +++ /dev/null @@ -1,232 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code -# is regenerated. -# ---------------------------------------------------------------------------------- - -<# -.Synopsis -Creates or updates a Collector Policy resource -.Description -Creates or updates a Collector Policy resource -.Example -{{ Add code here }} -.Example -{{ Add code here }} -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy -.Notes -COMPLEX PARAMETER PROPERTIES -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -EMISSIONPOLICY : Emission policies. - [EmissionDestination ]: Emission policy destinations. - [DestinationType ]: Emission destination type. - [EmissionType ]: Emission format type. -INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. - [ResourceId ]: Resource ID. - [SourceType ]: Ingestion source type. -.Link -https://docs.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy -#> -function New-AzNetworkFunctionCollectorPolicy { - [OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy])] - [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] - param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Azure Traffic Collector name - ${AzureTrafficCollectorName}, - - [Parameter(Mandatory)] - [Alias('CollectorPolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Collector Policy Name - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # The name of the resource group. - ${ResourceGroupName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [System.String] - # Resource location. - ${Location}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IEmissionPoliciesPropertiesFormat[]] - # Emission policies. - # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. - ${EmissionPolicy}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IIngestionSourcesPropertiesFormat[]] - # Ingestion Sources. - # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. - ${IngestionPolicyIngestionSource}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType] - # The ingestion type. - ${IngestionPolicyIngestionType}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] - [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. - ${DefaultProfile}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} - ) - - begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - } - - process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - - } - end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - } - } \ No newline at end of file diff --git a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..17314e7b1311 --- /dev/null +++ b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; + using System; + + /// Creates or updates a Collector Policy resource + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}" + /// + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy))] + public partial class NewAzNetworkFunctionCollectorPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener + { + /// Resource location. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => ParametersBody.Location; set => ParametersBody.Location = value; } + } +} \ No newline at end of file From d1efa743a55e61d70a39e298b6a3c8bacab7516b Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Wed, 20 Jul 2022 15:24:55 -0700 Subject: [PATCH 15/28] New cmdlet csharp bug fix --- src/NetworkFunction/custom/Models/CollectorPolicy.cs | 8 +++++++- .../NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/NetworkFunction/custom/Models/CollectorPolicy.cs b/src/NetworkFunction/custom/Models/CollectorPolicy.cs index 033a9a00d356..6b9875103a1c 100644 --- a/src/NetworkFunction/custom/Models/CollectorPolicy.cs +++ b/src/NetworkFunction/custom/Models/CollectorPolicy.cs @@ -13,9 +13,15 @@ public partial class CollectorPolicy : Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IValidates { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.TrackedResource(); + /// Resource location. [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResourceInternal)__resource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } } /// Collector policy resource. public partial interface ICollectorPolicy : diff --git a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs index 17314e7b1311..16c49fa74361 100644 --- a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs +++ b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs @@ -25,6 +25,6 @@ public partial class NewAzNetworkFunctionCollectorPolicy_CreateExpanded : global Description = @"Resource location.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] - public string Location { get => ParametersBody.Location; set => ParametersBody.Location = value; } + public string Location { get => _parametersBody.Location; set => _parametersBody.Location = value; } } } \ No newline at end of file From be35ed570309412dd303dfd37fcf72a2049c6712 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Thu, 21 Jul 2022 09:27:05 -0700 Subject: [PATCH 16/28] change operationId in readme --- src/NetworkFunction/README.md | 9 +- ...tAzNetworkFunctionTrafficCollector_List.cs | 410 ------------------ 2 files changed, 3 insertions(+), 416 deletions(-) delete mode 100644 src/NetworkFunction/custom/GetAzNetworkFunctionTrafficCollector_List.cs diff --git a/src/NetworkFunction/README.md b/src/NetworkFunction/README.md index 3e3a43870ebf..0f24041815d6 100644 --- a/src/NetworkFunction/README.md +++ b/src/NetworkFunction/README.md @@ -44,12 +44,9 @@ directive: - where: variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ hide: true - - where: - subject: (.)*(ByResourceGroup)$ - hide: true - - where: - subject: (.)*(BySubscription)$ - hide: true + - from: swagger-document + where: $.paths..operationId + transform: return $.replace(/^(AzureTrafficCollectors)(.+)(_List)$/, "$1$3$2") - where: subject: (.)*(Operation)$ hide: true diff --git a/src/NetworkFunction/custom/GetAzNetworkFunctionTrafficCollector_List.cs b/src/NetworkFunction/custom/GetAzNetworkFunctionTrafficCollector_List.cs deleted file mode 100644 index e7816a73af6e..000000000000 --- a/src/NetworkFunction/custom/GetAzNetworkFunctionTrafficCollector_List.cs +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; - using System; - - /// Return list of Azure Traffic Collectors in a Resource Group - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkFunctionTrafficCollector_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollector))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Return list of Azure Traffic Collectors in a Resource Group")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] - public partial class GetAzNetworkFunctionTrafficCollector_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A flag to tell whether it is the first onOK call. - private bool _isFirst = true; - - /// Link to retrieve next page. - private string _nextLink; - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.NetworkFunction Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.ClientAPI; - - /// - /// The credentials, account, tenant, and subscription used for communication with Azure - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } - - /// SendAsync Pipeline Steps to be prepended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.HttpPipeline Pipeline { get; set; } - - /// The URI for the proxy server to use - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Uri Proxy { get; set; } - - /// Credentials for a proxy server to use for the remote call - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } - - /// Use the default credentials for the proxy - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Backing field for property. - private string _resourceGroupName; - - /// The name of the resource group. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the resource group.")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name of the resource group.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string[] _subscriptionId; - - /// Azure Subscription ID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Azure Subscription ID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Path)] - public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICloudError - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollectorListResult - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - - } - - /// - /// Intializes a new instance of the cmdlet class. - /// - public GetAzNetworkFunctionTrafficCollector_List() - { - - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) - { - using( NoSynchronizationContext ) - { - if (token.IsCancellationRequested) - { - return ; - } - - switch ( id ) - { - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); - if (token.IsCancellationRequested) - { - return ; - } - WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); - } - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token); - } - } - catch (global::System.AggregateException aggregateException) - { - // unroll the inner exceptions to get the root cause - foreach( var innerException in aggregateException.Flatten().InnerExceptions ) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - // Write exception out to error channel. - WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); - } - } - catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - // Write exception out to error channel. - WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); - } - finally - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordEnd).Wait(); - } - } - - /// Performs execution of the command, working asynchronously if required. - /// - /// A that will be complete when handling of the method is completed. - /// - protected async global::System.Threading.Tasks.Task ProcessRecordAsync() - { - using( NoSynchronizationContext ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AzureTrafficCollectorsByResourceGroupList(ResourceGroupName, SubscriptionId, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICloudError - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollectorListResult - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnOk(responseMessage, response, ref _returnNow); - // if overrideOnOk has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IAzureTrafficCollectorListResult - var result = await response; - WriteObject(result.Value,true); - _nextLink = result.NextLink; - if (_isFirst) - { - _isFirst = false; - while (_nextLink != null) - { - if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) - { - requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Method.Get ); - await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AzureTrafficCollectorsByResourceGroupList_Call(requestMessage, onOk, onDefault, this, Pipeline); - } - } - } - } - } - } -} \ No newline at end of file From 39e45d294380c65bc52e89e69a0cfc955ff34f72 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Thu, 21 Jul 2022 11:40:13 -0700 Subject: [PATCH 17/28] Changed functions to export --- src/NetworkFunction/Az.NetworkFunction.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetworkFunction/Az.NetworkFunction.psd1 b/src/NetworkFunction/Az.NetworkFunction.psd1 index b8646ac0f8dc..6c8df30ff978 100644 --- a/src/NetworkFunction/Az.NetworkFunction.psd1 +++ b/src/NetworkFunction/Az.NetworkFunction.psd1 @@ -11,7 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.NetworkFunction.private.dll' FormatsToProcess = './Az.NetworkFunction.format.ps1xml' - FunctionsToExport = 'Get-AzNetworkFunctionOperation', 'Get-AzNetworkFunctionTrafficCollector', 'Get-AzNetworkFunctionTrafficCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionTrafficCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionTrafficCollectorPolicy', 'Set-AzNetworkFunctionTrafficCollector', 'Set-AzNetworkFunctionTrafficCollectorPolicy', 'Update-AzNetworkFunctionTrafficCollectorTag', '*' + FunctionsToExport = 'Get-AzNetworkFunctionTrafficCollector', 'Get-AzNetworkFunctionTrafficCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionTrafficCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionTrafficCollectorPolicy', 'Set-AzNetworkFunctionTrafficCollector', 'Set-AzNetworkFunctionTrafficCollectorPolicy', 'Update-AzNetworkFunctionTrafficCollectorTag', '*' AliasesToExport = '*' PrivateData = @{ PSData = @{ From 6c2a104d2d69a96295c5488317ae808f2eefa148 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Thu, 21 Jul 2022 14:37:23 -0700 Subject: [PATCH 18/28] removing new cmdlet --- .../custom/Models/CollectorPolicy.cs | 47 ------------------- ...kFunctionCollectorPolicy_CreateExpanded.cs | 30 ------------ 2 files changed, 77 deletions(-) delete mode 100644 src/NetworkFunction/custom/Models/CollectorPolicy.cs delete mode 100644 src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs diff --git a/src/NetworkFunction/custom/Models/CollectorPolicy.cs b/src/NetworkFunction/custom/Models/CollectorPolicy.cs deleted file mode 100644 index 6b9875103a1c..000000000000 --- a/src/NetworkFunction/custom/Models/CollectorPolicy.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; - - /// Collector policy resource. - public partial class CollectorPolicy : - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy, - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicyInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.TrackedResource(); - - /// Resource location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } - } - /// Collector policy resource. - public partial interface ICollectorPolicy : - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResource - { - /// Location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = true, - ReadOnly = true, - Description = @"Location.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string Location { get; set;} - } - /// Collector policy resource. - internal partial interface ICollectorPolicyInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.IProxyResourceInternal - { - /// The location of Collection Policy in a Traffic Collector. - string Location { get; set; } - } -} \ No newline at end of file diff --git a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs b/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs deleted file mode 100644 index 16c49fa74361..000000000000 --- a/src/NetworkFunction/custom/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Extensions; - using System; - - /// Creates or updates a Collector Policy resource - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}" - /// - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220501.ICollectorPolicy))] - public partial class NewAzNetworkFunctionCollectorPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener - { - /// Resource location. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Resource location.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - public string Location { get => _parametersBody.Location; set => _parametersBody.Location = value; } - } -} \ No newline at end of file From eccb83ba0f2f7998e87601558249d0b993a4f32a Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Fri, 29 Jul 2022 09:29:07 -0700 Subject: [PATCH 19/28] Updated swagger commit id --- src/NetworkFunction/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NetworkFunction/README.md b/src/NetworkFunction/README.md index 0f24041815d6..7673d846d918 100644 --- a/src/NetworkFunction/README.md +++ b/src/NetworkFunction/README.md @@ -24,11 +24,11 @@ For information on how to develop for `Az.NetworkFunction`, see [how-to.md](how- > see https://aka.ms/autorest ``` yaml -branch: 2f47130d8fb333f55596ca9d149fbdceaff6f4be +branch: 1cefdabe75c75323c6d3def3f6c80850c624bdea require: - $(this-folder)/../readme.azure.noprofile.md input-file: - - $(repo)/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/AzureTrafficCollector.json + - $(repo)/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-08-01/AzureTrafficCollector.json module-version: 0.1.0 title: NetworkFunction subject-prefix: $(service-name) From cf1fd662bfbea4fcb4206e8715db2e0169f32448 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Wed, 3 Aug 2022 08:58:49 -0700 Subject: [PATCH 20/28] added customization for location property --- .../New-AzNetworkFunctionCollectorPolicy.ps1 | 210 ++++++++++++++++++ .../New-AzNetworkFunctionTrafficCollector.ps1 | 198 +++++++++++++++++ .../Set-AzNetworkFunctionCollectorPolicy.ps1 | 210 ++++++++++++++++++ .../Set-AzNetworkFunctionTrafficCollector.ps1 | 198 +++++++++++++++++ 4 files changed, 816 insertions(+) create mode 100644 src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 create mode 100644 src/NetworkFunction/custom/New-AzNetworkFunctionTrafficCollector.ps1 create mode 100644 src/NetworkFunction/custom/Set-AzNetworkFunctionCollectorPolicy.ps1 create mode 100644 src/NetworkFunction/custom/Set-AzNetworkFunctionTrafficCollector.ps1 diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 new file mode 100644 index 000000000000..960a0ab00b9d --- /dev/null +++ b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a Collector Policy resource +.Description +Creates or updates a Collector Policy resource +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +EMISSIONPOLICY : Emission policies. + [EmissionDestination ]: Emission policy destinations. + [DestinationType ]: Emission destination type. + [EmissionType ]: Emission format type. + +INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. + [ResourceId ]: Resource ID. + [SourceType ]: Ingestion source type. +.Link +https://docs.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy +#> +function New-AzNetworkFunctionCollectorPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${AzureTrafficCollectorName}, + + [Parameter(Mandatory)] + [Alias('CollectorPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Collector Policy Name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IEmissionPoliciesPropertiesFormat[]] + # Emission policies. + # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. + ${EmissionPolicy}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IIngestionSourcesPropertiesFormat[]] + # Ingestion Sources. + # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. + ${IngestionPolicyIngestionSource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType] + # The ingestion type. + ${IngestionPolicyIngestionType}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ + CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + throw + } +} + +end { + try { + $steppablePipeline.End() + } catch { + throw + } +} +} diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionTrafficCollector.ps1 new file mode 100644 index 000000000000..f65829b52edc --- /dev/null +++ b/src/NetworkFunction/custom/New-AzNetworkFunctionTrafficCollector.ps1 @@ -0,0 +1,198 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a Azure Traffic Collector resource +.Description +Creates or updates a Azure Traffic Collector resource +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +COLLECTORPOLICY : Collector Policies for Azure Traffic Collector. + [Location ]: Resource location. + [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). + [SystemDataCreatedBy ]: The identity that created the resource. + [SystemDataCreatedByType ]: The type of identity that created the resource. + [SystemDataLastModifiedBy ]: The identity that last modified the resource. + [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. + [Tag ]: Resource tags. + [(Any) ]: This indicates any property can be added to this object. + [EmissionPolicy ]: Emission policies. + [EmissionDestination ]: Emission policy destinations. + [DestinationType ]: Emission destination type. + [EmissionType ]: Emission format type. + [IngestionPolicyIngestionSource ]: Ingestion Sources. + [ResourceId ]: Resource ID. + [SourceType ]: Ingestion source type. + [IngestionPolicyIngestionType ]: The ingestion type. +.Link +https://docs.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctiontrafficcollector +#> +function New-AzNetworkFunctionTrafficCollector { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('AzureTrafficCollectorName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy[]] + # Collector Policies for Azure Traffic Collector. + # To construct, see NOTES section for COLLECTORPOLICY properties and create a hash table. + ${CollectorPolicy}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ + CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionTrafficCollector_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + throw + } +} + +end { + try { + $steppablePipeline.End() + } catch { + throw + } +} +} diff --git a/src/NetworkFunction/custom/Set-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/Set-AzNetworkFunctionCollectorPolicy.ps1 new file mode 100644 index 000000000000..f61e6814bd29 --- /dev/null +++ b/src/NetworkFunction/custom/Set-AzNetworkFunctionCollectorPolicy.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a Collector Policy resource +.Description +Creates or updates a Collector Policy resource +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +EMISSIONPOLICY : Emission policies. + [EmissionDestination ]: Emission policy destinations. + [DestinationType ]: Emission destination type. + [EmissionType ]: Emission format type. + +INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. + [ResourceId ]: Resource ID. + [SourceType ]: Ingestion source type. +.Link +https://docs.microsoft.com/powershell/module/az.networkfunction/set-aznetworkfunctioncollectorpolicy +#> +function Set-AzNetworkFunctionCollectorPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${AzureTrafficCollectorName}, + + [Parameter(Mandatory)] + [Alias('CollectorPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Collector Policy Name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IEmissionPoliciesPropertiesFormat[]] + # Emission policies. + # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. + ${EmissionPolicy}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IIngestionSourcesPropertiesFormat[]] + # Ingestion Sources. + # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. + ${IngestionPolicyIngestionSource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType] + # The ingestion type. + ${IngestionPolicyIngestionType}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ + UpdateExpanded = 'Az.NetworkFunction.private\Set-AzNetworkFunctionCollectorPolicy_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + throw + } +} + +end { + try { + $steppablePipeline.End() + } catch { + throw + } +} +} diff --git a/src/NetworkFunction/custom/Set-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/custom/Set-AzNetworkFunctionTrafficCollector.ps1 new file mode 100644 index 000000000000..f90ecb853573 --- /dev/null +++ b/src/NetworkFunction/custom/Set-AzNetworkFunctionTrafficCollector.ps1 @@ -0,0 +1,198 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a Azure Traffic Collector resource +.Description +Creates or updates a Azure Traffic Collector resource +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +COLLECTORPOLICY : Collector Policies for Azure Traffic Collector. + [Location ]: Resource location. + [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). + [SystemDataCreatedBy ]: The identity that created the resource. + [SystemDataCreatedByType ]: The type of identity that created the resource. + [SystemDataLastModifiedBy ]: The identity that last modified the resource. + [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. + [Tag ]: Resource tags. + [(Any) ]: This indicates any property can be added to this object. + [EmissionPolicy ]: Emission policies. + [EmissionDestination ]: Emission policy destinations. + [DestinationType ]: Emission destination type. + [EmissionType ]: Emission format type. + [IngestionPolicyIngestionSource ]: Ingestion Sources. + [ResourceId ]: Resource ID. + [SourceType ]: Ingestion source type. + [IngestionPolicyIngestionType ]: The ingestion type. +.Link +https://docs.microsoft.com/powershell/module/az.networkfunction/set-aznetworkfunctiontrafficcollector +#> +function Set-AzNetworkFunctionTrafficCollector { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('AzureTrafficCollectorName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy[]] + # Collector Policies for Azure Traffic Collector. + # To construct, see NOTES section for COLLECTORPOLICY properties and create a hash table. + ${CollectorPolicy}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ + UpdateExpanded = 'Az.NetworkFunction.private\Set-AzNetworkFunctionTrafficCollector_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + throw + } +} + +end { + try { + $steppablePipeline.End() + } catch { + throw + } +} +} From 1b5568d7903fab295af7be518f8783014c6a3bd6 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Wed, 3 Aug 2022 10:21:38 -0700 Subject: [PATCH 21/28] Adding all files after running buildmodule --- src/NetworkFunction/.gitignore | 11 +++++++++++ src/NetworkFunction/Az.NetworkFunction.psd1 | 2 +- src/NetworkFunction/README.md | 14 +++++++++++--- ...AzNetworkFunctionTrafficCollectorPolicy.md | 19 +++++++++++++++++-- ...AzNetworkFunctionTrafficCollectorPolicy.md | 19 +++++++++++++++++-- ...AzNetworkFunctionTrafficCollectorPolicy.md | 2 +- ...AzNetworkFunctionTrafficCollectorPolicy.md | 2 +- src/NetworkFunction/resources/README.md | 11 +++++++++++ 8 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 src/NetworkFunction/resources/README.md diff --git a/src/NetworkFunction/.gitignore b/src/NetworkFunction/.gitignore index 6d872dc2faaf..3c3d57339c8b 100644 --- a/src/NetworkFunction/.gitignore +++ b/src/NetworkFunction/.gitignore @@ -1,5 +1,16 @@ bin obj .vs +generated +internal +exports tools +custom/*.psm1 +custom/autogen-model-cmdlets test/*-TestResults.xml +/*.ps1 +/*.ps1xml +/*.psm1 +/*.snk +/*.csproj +/*.nuspec \ No newline at end of file diff --git a/src/NetworkFunction/Az.NetworkFunction.psd1 b/src/NetworkFunction/Az.NetworkFunction.psd1 index 6c8df30ff978..4175bcb132c7 100644 --- a/src/NetworkFunction/Az.NetworkFunction.psd1 +++ b/src/NetworkFunction/Az.NetworkFunction.psd1 @@ -11,7 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.NetworkFunction.private.dll' FormatsToProcess = './Az.NetworkFunction.format.ps1xml' - FunctionsToExport = 'Get-AzNetworkFunctionTrafficCollector', 'Get-AzNetworkFunctionTrafficCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionTrafficCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionTrafficCollectorPolicy', 'Set-AzNetworkFunctionTrafficCollector', 'Set-AzNetworkFunctionTrafficCollectorPolicy', 'Update-AzNetworkFunctionTrafficCollectorTag', '*' + FunctionsToExport = 'Get-AzNetworkFunctionCollectorPolicy', 'Get-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Set-AzNetworkFunctionCollectorPolicy', 'Set-AzNetworkFunctionTrafficCollector', 'Update-AzNetworkFunctionTrafficCollectorTag', '*' AliasesToExport = '*' PrivateData = @{ PSData = @{ diff --git a/src/NetworkFunction/README.md b/src/NetworkFunction/README.md index 7673d846d918..2516b831923f 100644 --- a/src/NetworkFunction/README.md +++ b/src/NetworkFunction/README.md @@ -1,6 +1,6 @@ # Az.NetworkFunction -This directory contains the PowerShell module for the Az.NetworkFunction service. +This directory contains the PowerShell module for the NetworkFunction service. --- ## Status @@ -16,6 +16,12 @@ This directory contains the PowerShell module for the Az.NetworkFunction service ## Detail This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + ## Development For information on how to develop for `Az.NetworkFunction`, see [how-to.md](how-to.md). @@ -50,5 +56,7 @@ directive: - where: subject: (.)*(Operation)$ hide: true - -``` \ No newline at end of file + - where: + verb: New|Set + hide: true +``` diff --git a/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollectorPolicy.md index 81dfae736d94..892eb45be4c2 100644 --- a/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollectorPolicy.md @@ -15,7 +15,7 @@ Creates or updates a Collector Policy resource ### CreateExpanded (Default) ``` New-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName - -ResourceGroupName [-SubscriptionId ] + -ResourceGroupName -Location [-SubscriptionId ] [-EmissionPolicyList ] [-IngestionPolicyIngestionSourceList ] [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] @@ -24,7 +24,7 @@ New-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName ### Create ``` New-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName - -ResourceGroupName -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] + -ResourceGroupName -Location -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` @@ -116,6 +116,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -EmissionPolicyList Emission policies. To construct, see NOTES section for EMISSIONPOLICIES properties and create a hash table. diff --git a/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollectorPolicy.md index 88b7e7a3700f..3c71e53e4f9a 100644 --- a/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollectorPolicy.md @@ -15,7 +15,7 @@ Creates or updates a Collector Policy resource ### UpdateExpanded (Default) ``` Set-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName - -ResourceGroupName [-SubscriptionId ] + -ResourceGroupName -Location [-SubscriptionId ] [-EmissionPolicyList ] [-IngestionPolicyIngestionSourceList ] [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] @@ -24,7 +24,7 @@ Set-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName ### Update ``` Set-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName - -ResourceGroupName -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] + -ResourceGroupName -Location -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` @@ -116,6 +116,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -EmissionPolicyList Emission policies. To construct, see NOTES section for EMISSIONPOLICIES properties and create a hash table. diff --git a/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollectorPolicy.md index 309f9100e7fe..f9f533aa9368 100644 --- a/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollectorPolicy.md @@ -1,6 +1,6 @@ ### Example 1: Create a new traffic collector policy ```powershell -New-AzNetworkFunctionTrafficCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 +New-AzNetworkFunctionTrafficCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus ``` ```output diff --git a/src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollectorPolicy.md index 2bb52c68a0a9..cae4f8b3f2a0 100644 --- a/src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollectorPolicy.md @@ -1,6 +1,6 @@ ### Example 1: Update a traffic collector policy ```powershell -Set-AzNetworkFunctionTrafficCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 +Set-AzNetworkFunctionTrafficCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus ``` ```output diff --git a/src/NetworkFunction/resources/README.md b/src/NetworkFunction/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/src/NetworkFunction/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file From 8a0489a33b5e7a4f365b02c77fb88a243d4a1017 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Wed, 3 Aug 2022 14:44:59 -0700 Subject: [PATCH 22/28] updated docs and examples --- ...> Get-AzNetworkFunctionCollectorPolicy.md} | 55 ++++++++++------ .../Get-AzNetworkFunctionTrafficCollector.md | 64 ++++++++++++++++--- ...> New-AzNetworkFunctionCollectorPolicy.md} | 59 +++++++++++------ .../New-AzNetworkFunctionTrafficCollector.md | 28 ++++---- ...emove-AzNetworkFunctionCollectorPolicy.md} | 28 +++----- ...emove-AzNetworkFunctionTrafficCollector.md | 19 ++---- ...> Set-AzNetworkFunctionCollectorPolicy.md} | 58 +++++++++++------ .../Set-AzNetworkFunctionTrafficCollector.md | 29 ++++----- ...te-AzNetworkFunctionTrafficCollectorTag.md | 37 ++++++----- ...> Get-AzNetworkFunctionCollectorPolicy.md} | 2 +- ...> New-AzNetworkFunctionCollectorPolicy.md} | 2 +- ...Remove-AzNetworkFunctionCollectorPolicy.md | 11 ++++ ...AzNetworkFunctionTrafficCollectorPolicy.md | 13 ---- ...> Set-AzNetworkFunctionCollectorPolicy.md} | 2 +- ...zNetworkFunctionCollectorPolicy.Tests.ps1} | 6 +- ...zNetworkFunctionCollectorPolicy.Tests.ps1} | 6 +- ...zNetworkFunctionCollectorPolicy.Tests.ps1} | 6 +- ...zNetworkFunctionCollectorPolicy.Tests.ps1} | 6 +- 18 files changed, 256 insertions(+), 175 deletions(-) rename src/NetworkFunction/docs/{Get-AzNetworkFunctionTrafficCollectorPolicy.md => Get-AzNetworkFunctionCollectorPolicy.md} (68%) rename src/NetworkFunction/docs/{New-AzNetworkFunctionTrafficCollectorPolicy.md => New-AzNetworkFunctionCollectorPolicy.md} (83%) rename src/NetworkFunction/docs/{Remove-AzNetworkFunctionTrafficCollectorPolicy.md => Remove-AzNetworkFunctionCollectorPolicy.md} (88%) rename src/NetworkFunction/docs/{Set-AzNetworkFunctionTrafficCollectorPolicy.md => Set-AzNetworkFunctionCollectorPolicy.md} (83%) rename src/NetworkFunction/examples/{Get-AzNetworkFunctionTrafficCollectorPolicy.md => Get-AzNetworkFunctionCollectorPolicy.md} (90%) rename src/NetworkFunction/examples/{New-AzNetworkFunctionTrafficCollectorPolicy.md => New-AzNetworkFunctionCollectorPolicy.md} (88%) create mode 100644 src/NetworkFunction/examples/Remove-AzNetworkFunctionCollectorPolicy.md delete mode 100644 src/NetworkFunction/examples/Remove-AzNetworkFunctionTrafficCollectorPolicy.md rename src/NetworkFunction/examples/{Set-AzNetworkFunctionTrafficCollectorPolicy.md => Set-AzNetworkFunctionCollectorPolicy.md} (87%) rename src/NetworkFunction/test/{Get-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 => Get-AzNetworkFunctionCollectorPolicy.Tests.ps1} (87%) rename src/NetworkFunction/test/{New-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 => New-AzNetworkFunctionCollectorPolicy.Tests.ps1} (88%) rename src/NetworkFunction/test/{Remove-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 => Remove-AzNetworkFunctionCollectorPolicy.Tests.ps1} (85%) rename src/NetworkFunction/test/{Set-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 => Set-AzNetworkFunctionCollectorPolicy.Tests.ps1} (88%) diff --git a/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/docs/Get-AzNetworkFunctionCollectorPolicy.md similarity index 68% rename from src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollectorPolicy.md rename to src/NetworkFunction/docs/Get-AzNetworkFunctionCollectorPolicy.md index 2c02b1496cc2..a1b44dc1a538 100644 --- a/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/docs/Get-AzNetworkFunctionCollectorPolicy.md @@ -1,11 +1,11 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/get-aznetworkfunctiontrafficcollectorpolicy +online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/get-aznetworkfunctioncollectorpolicy schema: 2.0.0 --- -# Get-AzNetworkFunctionTrafficCollectorPolicy +# Get-AzNetworkFunctionCollectorPolicy ## SYNOPSIS Gets the collector policy in a specified Traffic Collector @@ -14,19 +14,19 @@ Gets the collector policy in a specified Traffic Collector ### List (Default) ``` -Get-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -ResourceGroupName +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -ResourceGroupName [-SubscriptionId ] [] ``` ### Get ``` -Get-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName -ResourceGroupName [-SubscriptionId ] [] ``` ### GetViaIdentity ``` -Get-AzNetworkFunctionTrafficCollectorPolicy -InputObject [] +Get-AzNetworkFunctionCollectorPolicy -InputObject [] ``` ## DESCRIPTION @@ -34,27 +34,44 @@ Gets the collector policy in a specified Traffic Collector ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Get list of collector policies by atc name and resource group ```powershell -{{ Add code here }} +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName test -resourcegroup test ``` ```output -{{ Add output here }} +[{ +"name": "atc", +"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1", +"etag": "testEtag", +"type": "Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies", +"properties": { + "ingestionPolicy": { + "ingestionType": "IPFIX", + "ingestionSources": [ + { + "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", + "sourceType": "Resource" + } + ] + }, + "emissionPolicies": [ + { + "emissionType": "IPFIX", + "emissionDestinations": [ + { + "destinationType": "AzureMonitor" + } + ] + } + ], + "provisioningState": "Succeeded" +} +}] ``` -{{ Add description here }} +This cmdlet gets list of traffic collector policies by atc name and resource group. -### Example 2: {{ Add title here }} -```powershell -{{ Add code here }} -``` - -```output -{{ Add output here }} -``` - -{{ Add description here }} ## PARAMETERS diff --git a/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollector.md index a0159e2fc047..c84ef69e711a 100644 --- a/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollector.md @@ -34,27 +34,75 @@ Gets the specified Azure Traffic Collector in a specified resource group ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Get list of traffic collectors in selected subscription ```powershell -{{ Add code here }} +Get-AzNetworkFunctionTrafficCollector ``` ```output -{{ Add output here }} +[{ + "CollectorPolicies": [ + "testPolicy" + ], + "Etag": "testEtag", + "Id": "id", + "Location": "location", + "Name": "atcname", + "ProvisioningState": {}, + "Tags": {}, + "Type": "Microsoft.NetworkFunction/AzureTrafficCollectors", + "VirtualHubId": null + }] ``` -{{ Add description here }} +This cmdlet gets list of traffic collectors in selected subscription. -### Example 2: {{ Add title here }} +### Example 2: Get list of traffic collectors by resource group ```powershell -{{ Add code here }} +Get-AzNetworkFunctionTrafficCollector -ResourceGroup test ``` ```output -{{ Add output here }} +[{ + "CollectorPolicies": [ + "testPolicy" + ], + "Etag": "testEtag", + "Id": "id", + "Location": "location", + "Name": "atcname", + "ProvisioningState": {}, + "Tags": {}, + "Type": "Microsoft.NetworkFunction/AzureTrafficCollectors", + "VirtualHubId": null + }] ``` -{{ Add description here }} +This cmdlet gets list of traffic collectors by resource group. + +### Example 3: Get list of traffic collectors by name +```powershell +Get-AzNetworkFunctionTrafficCollector -ResourceGroup test -name test +``` + +```output +[{ + "CollectorPolicies": [ + "testPolicy" + ], + "Etag": "testEtag", + "Id": "id", + "Location": "location", + "Name": "atcname", + "ProvisioningState": {}, + "Tags": {}, + "Type": "Microsoft.NetworkFunction/AzureTrafficCollectors", + "VirtualHubId": null + }] +``` + +This cmdlet gets list of traffic collectors by name. + ## PARAMETERS diff --git a/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/docs/New-AzNetworkFunctionCollectorPolicy.md similarity index 83% rename from src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollectorPolicy.md rename to src/NetworkFunction/docs/New-AzNetworkFunctionCollectorPolicy.md index 892eb45be4c2..669fc24e0fe3 100644 --- a/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/docs/New-AzNetworkFunctionCollectorPolicy.md @@ -1,11 +1,11 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/new-aznetworkfunctiontrafficcollectorpolicy +online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy schema: 2.0.0 --- -# New-AzNetworkFunctionTrafficCollectorPolicy +# New-AzNetworkFunctionCollectorPolicy ## SYNOPSIS Creates or updates a Collector Policy resource @@ -14,7 +14,7 @@ Creates or updates a Collector Policy resource ### CreateExpanded (Default) ``` -New-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName +New-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName -ResourceGroupName -Location [-SubscriptionId ] [-EmissionPolicyList ] [-IngestionPolicyIngestionSourceList ] @@ -23,20 +23,20 @@ New-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName ### Create ``` -New-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName +New-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName -ResourceGroupName -Location -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` ### CreateViaIdentity ``` -New-AzNetworkFunctionTrafficCollectorPolicy -InputObject +New-AzNetworkFunctionCollectorPolicy -InputObject -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` ### CreateViaIdentityExpanded ``` -New-AzNetworkFunctionTrafficCollectorPolicy -InputObject +New-AzNetworkFunctionCollectorPolicy -InputObject [-EmissionPolicyList ] [-IngestionPolicyIngestionSourceList ] [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] @@ -47,27 +47,44 @@ Creates or updates a Collector Policy resource ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Create a new traffic collector policy ```powershell -{{ Add code here }} +New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus ``` ```output -{{ Add output here }} +{ + "name": "cp1", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/AzureTrafficCollector/atc/collectorPolicies/cp1", + "etag": "test", + "type": "Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies", + "properties": { + "ingestionPolicy": { + "ingestionType": "IPFIX", + "ingestionSources": [ + { + "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", + "sourceType": "Resource" + } + ] + }, + "emissionPolicies": [ + { + "emissionType": "IPFIX", + "emissionDestinations": [ + { + "destinationType": "AzureMonitor" + } + ] + } + ], + "provisioningState": "Succeeded" + } + } +} ``` -{{ Add description here }} - -### Example 2: {{ Add title here }} -```powershell -{{ Add code here }} -``` - -```output -{{ Add output here }} -``` - -{{ Add description here }} +This cmdlet creates a new traffic collector policy. ## PARAMETERS diff --git a/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollector.md index 3ae004c06c08..3adda8a286f0 100644 --- a/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollector.md @@ -44,27 +44,27 @@ Creates or updates a Azure Traffic Collector resource ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Create a new traffic collector ```powershell -{{ Add code here }} +New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus ``` ```output -{{ Add output here }} +{ + "CollectorPolicies": [], + "Etag": "testEtag", + "Id": "id", + "Location": "eastus", + "Name": "atctestps", + "ProvisioningState": {}, + "Tags": {}, + "Type": "Microsoft.NetworkFunction/AzureTrafficCollectors", + "VirtualHubId": null +} ``` -{{ Add description here }} +This cmdlet creates a new traffic collector. -### Example 2: {{ Add title here }} -```powershell -{{ Add code here }} -``` - -```output -{{ Add output here }} -``` - -{{ Add description here }} ## PARAMETERS diff --git a/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/docs/Remove-AzNetworkFunctionCollectorPolicy.md similarity index 88% rename from src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollectorPolicy.md rename to src/NetworkFunction/docs/Remove-AzNetworkFunctionCollectorPolicy.md index 90ba7245b93c..56159bbc0f57 100644 --- a/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/docs/Remove-AzNetworkFunctionCollectorPolicy.md @@ -1,11 +1,11 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/remove-aznetworkfunctiontrafficcollectorpolicy +online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/remove-aznetworkfunctioncollectorpolicy schema: 2.0.0 --- -# Remove-AzNetworkFunctionTrafficCollectorPolicy +# Remove-AzNetworkFunctionCollectorPolicy ## SYNOPSIS Deletes a specified Collector Policy resource. @@ -14,14 +14,14 @@ Deletes a specified Collector Policy resource. ### Delete (Default) ``` -Remove-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName +Remove-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName -ResourceGroupName [-SubscriptionId ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] ``` ### DeleteViaIdentity ``` -Remove-AzNetworkFunctionTrafficCollectorPolicy -InputObject [-AsJob] [-NoWait] +Remove-AzNetworkFunctionCollectorPolicy -InputObject [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] ``` @@ -30,27 +30,17 @@ Deletes a specified Collector Policy resource. ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Delete a new traffic collector policy ```powershell -{{ Add code here }} +Remove-AzNetworkFunctionCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroup test ``` ```output -{{ Add output here }} +{ +} ``` -{{ Add description here }} - -### Example 2: {{ Add title here }} -```powershell -{{ Add code here }} -``` - -```output -{{ Add output here }} -``` - -{{ Add description here }} +This cmdlet deletes a traffic collector policy. ## PARAMETERS diff --git a/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollector.md index 2f6d5d0aaa5f..0c329e098aa4 100644 --- a/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollector.md @@ -29,27 +29,18 @@ Deletes a specified Azure Traffic Collector resource. ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Delete a new traffic collector ```powershell -{{ Add code here }} +Remove-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup SEA-Cust10 ``` ```output -{{ Add output here }} +{ +} ``` -{{ Add description here }} +This cmdlet deletes a traffic collector. -### Example 2: {{ Add title here }} -```powershell -{{ Add code here }} -``` - -```output -{{ Add output here }} -``` - -{{ Add description here }} ## PARAMETERS diff --git a/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/docs/Set-AzNetworkFunctionCollectorPolicy.md similarity index 83% rename from src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollectorPolicy.md rename to src/NetworkFunction/docs/Set-AzNetworkFunctionCollectorPolicy.md index 3c71e53e4f9a..3904d9c1563d 100644 --- a/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/docs/Set-AzNetworkFunctionCollectorPolicy.md @@ -1,11 +1,11 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/set-aznetworkfunctiontrafficcollectorpolicy +online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/set-aznetworkfunctioncollectorpolicy schema: 2.0.0 --- -# Set-AzNetworkFunctionTrafficCollectorPolicy +# Set-AzNetworkFunctionCollectorPolicy ## SYNOPSIS Creates or updates a Collector Policy resource @@ -14,7 +14,7 @@ Creates or updates a Collector Policy resource ### UpdateExpanded (Default) ``` -Set-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName +Set-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName -ResourceGroupName -Location [-SubscriptionId ] [-EmissionPolicyList ] [-IngestionPolicyIngestionSourceList ] @@ -23,20 +23,20 @@ Set-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName ### Update ``` -Set-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName +Set-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName -ResourceGroupName -Location -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` ### UpdateViaIdentity ``` -Set-AzNetworkFunctionTrafficCollectorPolicy -InputObject +Set-AzNetworkFunctionCollectorPolicy -InputObject -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` ### UpdateViaIdentityExpanded ``` -Set-AzNetworkFunctionTrafficCollectorPolicy -InputObject +Set-AzNetworkFunctionCollectorPolicy -InputObject [-EmissionPolicyList ] [-IngestionPolicyIngestionSourceList ] [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] @@ -47,27 +47,45 @@ Creates or updates a Collector Policy resource ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Update a traffic collector policy ```powershell -{{ Add code here }} +Set-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus ``` ```output -{{ Add output here }} +{ + "name": "cp1", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/AzureTrafficCollector/atc/collectorPolicies/cp1", + "etag": "test", + "type": "Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies", + "properties": { + "ingestionPolicy": { + "ingestionType": "IPFIX", + "ingestionSources": [ + { + "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", + "sourceType": "Resource" + } + ] + }, + "emissionPolicies": [ + { + "emissionType": "IPFIX", + "emissionDestinations": [ + { + "destinationType": "AzureMonitor" + } + ] + } + ], + "provisioningState": "Succeeded" + } + } +} ``` -{{ Add description here }} +This cmdlet updates a traffic collector policy. -### Example 2: {{ Add title here }} -```powershell -{{ Add code here }} -``` - -```output -{{ Add output here }} -``` - -{{ Add description here }} ## PARAMETERS diff --git a/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollector.md index b0b853433d9d..a2e3a600329c 100644 --- a/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollector.md @@ -44,27 +44,26 @@ Creates or updates a Azure Traffic Collector resource ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Updates a traffic collector ```powershell -{{ Add code here }} +Set-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus ``` ```output -{{ Add output here }} +{ + "CollectorPolicies": [], + "Etag": "testEtag", + "Id": "id", + "Location": "eastus", + "Name": "atctestps", + "ProvisioningState": {}, + "Tags": {}, + "Type": "Microsoft.NetworkFunction/AzureTrafficCollectors", + "VirtualHubId": null +} ``` -{{ Add description here }} - -### Example 2: {{ Add title here }} -```powershell -{{ Add code here }} -``` - -```output -{{ Add output here }} -``` - -{{ Add description here }} +This cmdlet updates a traffic collector. ## PARAMETERS diff --git a/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollectorTag.md b/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollectorTag.md index 422144cb5236..44e82855d98f 100644 --- a/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollectorTag.md +++ b/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollectorTag.md @@ -41,27 +41,30 @@ Updates the specified Azure Traffic Collector tags. ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Updates a traffic collector tag ```powershell -{{ Add code here }} +Update-AzNetworkFunctionTrafficCollectorTag -azuretrafficcollectorname atc -resourcegroup rg1 ``` ```output -{{ Add output here }} -``` - -{{ Add description here }} - -### Example 2: {{ Add title here }} -```powershell -{{ Add code here }} -``` - -```output -{{ Add output here }} -``` - -{{ Add description here }} +{ + "name": "atc", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc", + "type": "Microsoft.NetworkFunction/azureTrafficCollectors", + "etag": "test", + "location": "West US", + "tags": { + "key1": "value1", + "key2": "value2" + }, + "properties": { + "collectorPolicies": [], + "provisioningState": "Succeeded" + } +} +``` + +This cmdlet updates a traffic collector tag. ## PARAMETERS diff --git a/src/NetworkFunction/examples/Get-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/examples/Get-AzNetworkFunctionCollectorPolicy.md similarity index 90% rename from src/NetworkFunction/examples/Get-AzNetworkFunctionTrafficCollectorPolicy.md rename to src/NetworkFunction/examples/Get-AzNetworkFunctionCollectorPolicy.md index 438066148723..3bbdbd94cf52 100644 --- a/src/NetworkFunction/examples/Get-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/examples/Get-AzNetworkFunctionCollectorPolicy.md @@ -1,6 +1,6 @@ ### Example 1: Get list of collector policies by atc name and resource group ```powershell -Get-AzNetworkFunctionTrafficCollectorPolicy -AzureTrafficCollectorName test -resourcegroup test +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName test -resourcegroup test ``` ```output diff --git a/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/examples/New-AzNetworkFunctionCollectorPolicy.md similarity index 88% rename from src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollectorPolicy.md rename to src/NetworkFunction/examples/New-AzNetworkFunctionCollectorPolicy.md index f9f533aa9368..66b8074437cf 100644 --- a/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/examples/New-AzNetworkFunctionCollectorPolicy.md @@ -1,6 +1,6 @@ ### Example 1: Create a new traffic collector policy ```powershell -New-AzNetworkFunctionTrafficCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus +New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus ``` ```output diff --git a/src/NetworkFunction/examples/Remove-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/examples/Remove-AzNetworkFunctionCollectorPolicy.md new file mode 100644 index 000000000000..e3667d3bf45b --- /dev/null +++ b/src/NetworkFunction/examples/Remove-AzNetworkFunctionCollectorPolicy.md @@ -0,0 +1,11 @@ +### Example 1: Delete a new traffic collector policy +```powershell +Remove-AzNetworkFunctionCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroup test +``` + +```output +{ +} +``` + +This cmdlet deletes a traffic collector policy. \ No newline at end of file diff --git a/src/NetworkFunction/examples/Remove-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/examples/Remove-AzNetworkFunctionTrafficCollectorPolicy.md deleted file mode 100644 index fbb1abcbe807..000000000000 --- a/src/NetworkFunction/examples/Remove-AzNetworkFunctionTrafficCollectorPolicy.md +++ /dev/null @@ -1,13 +0,0 @@ -### Example 1: Delete a new traffic collector policy -```powershell -Remove-AzNetworkFunctionTrafficCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroup test -``` - -```output -{ -} -``` - -This cmdlet deletes a traffic collector policy. - - diff --git a/src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollectorPolicy.md b/src/NetworkFunction/examples/Set-AzNetworkFunctionCollectorPolicy.md similarity index 87% rename from src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollectorPolicy.md rename to src/NetworkFunction/examples/Set-AzNetworkFunctionCollectorPolicy.md index cae4f8b3f2a0..081aba39191b 100644 --- a/src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollectorPolicy.md +++ b/src/NetworkFunction/examples/Set-AzNetworkFunctionCollectorPolicy.md @@ -1,6 +1,6 @@ ### Example 1: Update a traffic collector policy ```powershell -Set-AzNetworkFunctionTrafficCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus +Set-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus ``` ```output diff --git a/src/NetworkFunction/test/Get-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 b/src/NetworkFunction/test/Get-AzNetworkFunctionCollectorPolicy.Tests.ps1 similarity index 87% rename from src/NetworkFunction/test/Get-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 rename to src/NetworkFunction/test/Get-AzNetworkFunctionCollectorPolicy.Tests.ps1 index 99fb69a0fac6..c7acfa1ea0b7 100644 --- a/src/NetworkFunction/test/Get-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 +++ b/src/NetworkFunction/test/Get-AzNetworkFunctionCollectorPolicy.Tests.ps1 @@ -1,11 +1,11 @@ -if(($null -eq $TestName) -or ($TestName -contains 'Get-AzNetworkFunctionTrafficCollectorPolicy')) +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzNetworkFunctionCollectorPolicy')) { $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath) - $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzNetworkFunctionTrafficCollectorPolicy.Recording.json' + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzNetworkFunctionCollectorPolicy.Recording.json' $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File @@ -14,7 +14,7 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzNetworkFunctionTrafficC . ($mockingPath | Select-Object -First 1).FullName } -Describe 'Get-AzNetworkFunctionTrafficCollectorPolicy' { +Describe 'Get-AzNetworkFunctionCollectorPolicy' { It 'List' -skip { { throw [System.NotImplementedException] } | Should -Not -Throw } diff --git a/src/NetworkFunction/test/New-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 b/src/NetworkFunction/test/New-AzNetworkFunctionCollectorPolicy.Tests.ps1 similarity index 88% rename from src/NetworkFunction/test/New-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 rename to src/NetworkFunction/test/New-AzNetworkFunctionCollectorPolicy.Tests.ps1 index eb2eda5600cb..3a2d8caab562 100644 --- a/src/NetworkFunction/test/New-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 +++ b/src/NetworkFunction/test/New-AzNetworkFunctionCollectorPolicy.Tests.ps1 @@ -1,11 +1,11 @@ -if(($null -eq $TestName) -or ($TestName -contains 'New-AzNetworkFunctionTrafficCollectorPolicy')) +if(($null -eq $TestName) -or ($TestName -contains 'New-AzNetworkFunctionCollectorPolicy')) { $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath) - $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzNetworkFunctionTrafficCollectorPolicy.Recording.json' + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzNetworkFunctionCollectorPolicy.Recording.json' $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File @@ -14,7 +14,7 @@ if(($null -eq $TestName) -or ($TestName -contains 'New-AzNetworkFunctionTrafficC . ($mockingPath | Select-Object -First 1).FullName } -Describe 'New-AzNetworkFunctionTrafficCollectorPolicy' { +Describe 'New-AzNetworkFunctionCollectorPolicy' { It 'CreateExpanded' -skip { { throw [System.NotImplementedException] } | Should -Not -Throw } diff --git a/src/NetworkFunction/test/Remove-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 b/src/NetworkFunction/test/Remove-AzNetworkFunctionCollectorPolicy.Tests.ps1 similarity index 85% rename from src/NetworkFunction/test/Remove-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 rename to src/NetworkFunction/test/Remove-AzNetworkFunctionCollectorPolicy.Tests.ps1 index 47c4231ad6a3..357dc8360be7 100644 --- a/src/NetworkFunction/test/Remove-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 +++ b/src/NetworkFunction/test/Remove-AzNetworkFunctionCollectorPolicy.Tests.ps1 @@ -1,11 +1,11 @@ -if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzNetworkFunctionTrafficCollectorPolicy')) +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzNetworkFunctionCollectorPolicy')) { $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath) - $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzNetworkFunctionTrafficCollectorPolicy.Recording.json' + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzNetworkFunctionCollectorPolicy.Recording.json' $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File @@ -14,7 +14,7 @@ if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzNetworkFunctionTraff . ($mockingPath | Select-Object -First 1).FullName } -Describe 'Remove-AzNetworkFunctionTrafficCollectorPolicy' { +Describe 'Remove-AzNetworkFunctionCollectorPolicy' { It 'Delete' -skip { { throw [System.NotImplementedException] } | Should -Not -Throw } diff --git a/src/NetworkFunction/test/Set-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 b/src/NetworkFunction/test/Set-AzNetworkFunctionCollectorPolicy.Tests.ps1 similarity index 88% rename from src/NetworkFunction/test/Set-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 rename to src/NetworkFunction/test/Set-AzNetworkFunctionCollectorPolicy.Tests.ps1 index 7120f88b72ec..01f2ae490b2d 100644 --- a/src/NetworkFunction/test/Set-AzNetworkFunctionTrafficCollectorPolicy.Tests.ps1 +++ b/src/NetworkFunction/test/Set-AzNetworkFunctionCollectorPolicy.Tests.ps1 @@ -1,11 +1,11 @@ -if(($null -eq $TestName) -or ($TestName -contains 'Set-AzNetworkFunctionTrafficCollectorPolicy')) +if(($null -eq $TestName) -or ($TestName -contains 'Set-AzNetworkFunctionCollectorPolicy')) { $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath) - $TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzNetworkFunctionTrafficCollectorPolicy.Recording.json' + $TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzNetworkFunctionCollectorPolicy.Recording.json' $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File @@ -14,7 +14,7 @@ if(($null -eq $TestName) -or ($TestName -contains 'Set-AzNetworkFunctionTrafficC . ($mockingPath | Select-Object -First 1).FullName } -Describe 'Set-AzNetworkFunctionTrafficCollectorPolicy' { +Describe 'Set-AzNetworkFunctionCollectorPolicy' { It 'UpdateExpanded' -skip { { throw [System.NotImplementedException] } | Should -Not -Throw } From f212db6013b8519421f9387e05f1a9da8a810d4d Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Wed, 3 Aug 2022 15:23:09 -0700 Subject: [PATCH 23/28] minor typo --- src/NetworkFunction/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetworkFunction/README.md b/src/NetworkFunction/README.md index 2516b831923f..d3c0e6c76f5f 100644 --- a/src/NetworkFunction/README.md +++ b/src/NetworkFunction/README.md @@ -1,6 +1,6 @@ # Az.NetworkFunction -This directory contains the PowerShell module for the NetworkFunction service. +This directory contains the PowerShell module for the Az.NetworkFunction service. --- ## Status From 09c0c8ce7edb0ee8729badbf650ee426969a6dbb Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Thu, 4 Aug 2022 09:11:24 -0700 Subject: [PATCH 24/28] removed set cmdlet, simplified custom cmdlets --- .../New-AzNetworkFunctionCollectorPolicy.ps1 | 34 +-- .../New-AzNetworkFunctionTrafficCollector.ps1 | 34 +-- .../Set-AzNetworkFunctionCollectorPolicy.ps1 | 210 ------------------ .../Set-AzNetworkFunctionTrafficCollector.ps1 | 198 ----------------- 4 files changed, 2 insertions(+), 474 deletions(-) delete mode 100644 src/NetworkFunction/custom/Set-AzNetworkFunctionCollectorPolicy.ps1 delete mode 100644 src/NetworkFunction/custom/Set-AzNetworkFunctionTrafficCollector.ps1 diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 index 960a0ab00b9d..bf5c952a7c6c 100644 --- a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 @@ -168,41 +168,9 @@ param( ${ProxyUseDefaultCredentials} ) -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - $mapping = @{ - CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateExpanded'; - } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - throw - } -} - process { try { - $steppablePipeline.Process($_) - } catch { - throw - } -} - -end { - try { - $steppablePipeline.End() + Az.NetworkFunction.internal\New-AzNetworkFunctionTrafficCollector @PSBoundParameters } catch { throw } diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionTrafficCollector.ps1 index f65829b52edc..17137be71a3c 100644 --- a/src/NetworkFunction/custom/New-AzNetworkFunctionTrafficCollector.ps1 +++ b/src/NetworkFunction/custom/New-AzNetworkFunctionTrafficCollector.ps1 @@ -156,41 +156,9 @@ param( ${ProxyUseDefaultCredentials} ) -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - $mapping = @{ - CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionTrafficCollector_CreateExpanded'; - } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - throw - } -} - process { try { - $steppablePipeline.Process($_) - } catch { - throw - } -} - -end { - try { - $steppablePipeline.End() + Az.NetworkFunction.internal\New-AzNetworkFunctionTrafficCollector @PSBoundParameters } catch { throw } diff --git a/src/NetworkFunction/custom/Set-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/Set-AzNetworkFunctionCollectorPolicy.ps1 deleted file mode 100644 index f61e6814bd29..000000000000 --- a/src/NetworkFunction/custom/Set-AzNetworkFunctionCollectorPolicy.ps1 +++ /dev/null @@ -1,210 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code -# is regenerated. -# ---------------------------------------------------------------------------------- - -<# -.Synopsis -Creates or updates a Collector Policy resource -.Description -Creates or updates a Collector Policy resource -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -EMISSIONPOLICY : Emission policies. - [EmissionDestination ]: Emission policy destinations. - [DestinationType ]: Emission destination type. - [EmissionType ]: Emission format type. - -INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. - [ResourceId ]: Resource ID. - [SourceType ]: Ingestion source type. -.Link -https://docs.microsoft.com/powershell/module/az.networkfunction/set-aznetworkfunctioncollectorpolicy -#> -function Set-AzNetworkFunctionCollectorPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Azure Traffic Collector name - ${AzureTrafficCollectorName}, - - [Parameter(Mandatory)] - [Alias('CollectorPolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Collector Policy Name - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # The name of the resource group. - ${ResourceGroupName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IEmissionPoliciesPropertiesFormat[]] - # Emission policies. - # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. - ${EmissionPolicy}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IIngestionSourcesPropertiesFormat[]] - # Ingestion Sources. - # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. - ${IngestionPolicyIngestionSource}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType] - # The ingestion type. - ${IngestionPolicyIngestionType}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [System.String] - # Resource location. - ${Location}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] - [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. - ${DefaultProfile}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - $mapping = @{ - UpdateExpanded = 'Az.NetworkFunction.private\Set-AzNetworkFunctionCollectorPolicy_UpdateExpanded'; - } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - throw - } -} - -end { - try { - $steppablePipeline.End() - } catch { - throw - } -} -} diff --git a/src/NetworkFunction/custom/Set-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/custom/Set-AzNetworkFunctionTrafficCollector.ps1 deleted file mode 100644 index f90ecb853573..000000000000 --- a/src/NetworkFunction/custom/Set-AzNetworkFunctionTrafficCollector.ps1 +++ /dev/null @@ -1,198 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code -# is regenerated. -# ---------------------------------------------------------------------------------- - -<# -.Synopsis -Creates or updates a Azure Traffic Collector resource -.Description -Creates or updates a Azure Traffic Collector resource -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -COLLECTORPOLICY : Collector Policies for Azure Traffic Collector. - [Location ]: Resource location. - [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). - [SystemDataCreatedBy ]: The identity that created the resource. - [SystemDataCreatedByType ]: The type of identity that created the resource. - [SystemDataLastModifiedBy ]: The identity that last modified the resource. - [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. - [Tag ]: Resource tags. - [(Any) ]: This indicates any property can be added to this object. - [EmissionPolicy ]: Emission policies. - [EmissionDestination ]: Emission policy destinations. - [DestinationType ]: Emission destination type. - [EmissionType ]: Emission format type. - [IngestionPolicyIngestionSource ]: Ingestion Sources. - [ResourceId ]: Resource ID. - [SourceType ]: Ingestion source type. - [IngestionPolicyIngestionType ]: The ingestion type. -.Link -https://docs.microsoft.com/powershell/module/az.networkfunction/set-aznetworkfunctiontrafficcollector -#> -function Set-AzNetworkFunctionTrafficCollector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Alias('AzureTrafficCollectorName')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Azure Traffic Collector name - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # The name of the resource group. - ${ResourceGroupName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy[]] - # Collector Policies for Azure Traffic Collector. - # To construct, see NOTES section for COLLECTORPOLICY properties and create a hash table. - ${CollectorPolicy}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [System.String] - # Resource location. - ${Location}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] - [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. - ${DefaultProfile}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - $mapping = @{ - UpdateExpanded = 'Az.NetworkFunction.private\Set-AzNetworkFunctionTrafficCollector_UpdateExpanded'; - } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - throw - } -} - -end { - try { - $steppablePipeline.End() - } catch { - throw - } -} -} From 5f5a30d8d3b145c6f48b6974e9c1982209fa563e Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Thu, 4 Aug 2022 10:36:49 -0700 Subject: [PATCH 25/28] removed set cmdlet --- src/NetworkFunction/Az.NetworkFunction.psd1 | 2 +- .../New-AzNetworkFunctionCollectorPolicy.ps1 | 2 +- .../Set-AzNetworkFunctionCollectorPolicy.md | 355 ------------------ .../Set-AzNetworkFunctionTrafficCollector.md | 307 --------------- .../Set-AzNetworkFunctionCollectorPolicy.md | 38 -- .../Set-AzNetworkFunctionTrafficCollector.md | 20 - ...AzNetworkFunctionCollectorPolicy.Tests.ps1 | 33 -- ...zNetworkFunctionTrafficCollector.Tests.ps1 | 33 -- 8 files changed, 2 insertions(+), 788 deletions(-) delete mode 100644 src/NetworkFunction/docs/Set-AzNetworkFunctionCollectorPolicy.md delete mode 100644 src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollector.md delete mode 100644 src/NetworkFunction/examples/Set-AzNetworkFunctionCollectorPolicy.md delete mode 100644 src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollector.md delete mode 100644 src/NetworkFunction/test/Set-AzNetworkFunctionCollectorPolicy.Tests.ps1 delete mode 100644 src/NetworkFunction/test/Set-AzNetworkFunctionTrafficCollector.Tests.ps1 diff --git a/src/NetworkFunction/Az.NetworkFunction.psd1 b/src/NetworkFunction/Az.NetworkFunction.psd1 index 4175bcb132c7..c6b7e698622f 100644 --- a/src/NetworkFunction/Az.NetworkFunction.psd1 +++ b/src/NetworkFunction/Az.NetworkFunction.psd1 @@ -11,7 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.NetworkFunction.private.dll' FormatsToProcess = './Az.NetworkFunction.format.ps1xml' - FunctionsToExport = 'Get-AzNetworkFunctionCollectorPolicy', 'Get-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Set-AzNetworkFunctionCollectorPolicy', 'Set-AzNetworkFunctionTrafficCollector', 'Update-AzNetworkFunctionTrafficCollectorTag', '*' + FunctionsToExport = 'Get-AzNetworkFunctionCollectorPolicy', 'Get-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Update-AzNetworkFunctionTrafficCollectorTag', '*' AliasesToExport = '*' PrivateData = @{ PSData = @{ diff --git a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 index bf5c952a7c6c..148bbf160da6 100644 --- a/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1 @@ -170,7 +170,7 @@ param( process { try { - Az.NetworkFunction.internal\New-AzNetworkFunctionTrafficCollector @PSBoundParameters + Az.NetworkFunction.internal\New-AzNetworkFunctionCollectorPolicy @PSBoundParameters } catch { throw } diff --git a/src/NetworkFunction/docs/Set-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/docs/Set-AzNetworkFunctionCollectorPolicy.md deleted file mode 100644 index 3904d9c1563d..000000000000 --- a/src/NetworkFunction/docs/Set-AzNetworkFunctionCollectorPolicy.md +++ /dev/null @@ -1,355 +0,0 @@ ---- -external help file: -Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/set-aznetworkfunctioncollectorpolicy -schema: 2.0.0 ---- - -# Set-AzNetworkFunctionCollectorPolicy - -## SYNOPSIS -Creates or updates a Collector Policy resource - -## SYNTAX - -### UpdateExpanded (Default) -``` -Set-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName - -ResourceGroupName -Location [-SubscriptionId ] - [-EmissionPolicyList ] - [-IngestionPolicyIngestionSourceList ] - [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -### Update -``` -Set-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName - -ResourceGroupName -Location -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] - [-Confirm] [-WhatIf] [] -``` - -### UpdateViaIdentity -``` -Set-AzNetworkFunctionCollectorPolicy -InputObject - -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -### UpdateViaIdentityExpanded -``` -Set-AzNetworkFunctionCollectorPolicy -InputObject - [-EmissionPolicyList ] - [-IngestionPolicyIngestionSourceList ] - [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -## DESCRIPTION -Creates or updates a Collector Policy resource - -## EXAMPLES - -### Example 1: Update a traffic collector policy -```powershell -Set-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus -``` - -```output -{ - "name": "cp1", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/AzureTrafficCollector/atc/collectorPolicies/cp1", - "etag": "test", - "type": "Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies", - "properties": { - "ingestionPolicy": { - "ingestionType": "IPFIX", - "ingestionSources": [ - { - "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", - "sourceType": "Resource" - } - ] - }, - "emissionPolicies": [ - { - "emissionType": "IPFIX", - "emissionDestinations": [ - { - "destinationType": "AzureMonitor" - } - ] - } - ], - "provisioningState": "Succeeded" - } - } -} -``` - -This cmdlet updates a traffic collector policy. - - -## PARAMETERS - -### -AsJob -Run the command as a job - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -AzureTrafficCollectorName -Azure Traffic Collector name - -```yaml -Type: System.String -Parameter Sets: Update, UpdateExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -CollectorPolicyName -Collector Policy Name - -```yaml -Type: System.String -Parameter Sets: Update, UpdateExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Location -Resource location. - -```yaml -Type: System.String -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -EmissionPolicyList -Emission policies. -To construct, see NOTES section for EMISSIONPOLICIES properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IEmissionPoliciesPropertiesFormat[] -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -IngestionPolicyIngestionSourceList -Ingestion Sources. -To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCES properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IIngestionSourcesPropertiesFormat[] -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -IngestionPolicyIngestionType -The ingestion type. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity -Parameter Sets: UpdateViaIdentity, UpdateViaIdentityExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -NoWait -Run the command asynchronously - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Parameters -Collection policy resource. -To construct, see NOTES section for PARAMETERS properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy -Parameter Sets: Update, UpdateViaIdentity -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -ResourceGroupName -The name of the resource group. - -```yaml -Type: System.String -Parameter Sets: Update, UpdateExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SubscriptionId -Azure Subscription ID. - -```yaml -Type: System.String -Parameter Sets: Update, UpdateExpanded -Aliases: - -Required: False -Position: Named -Default value: (Get-AzContext).Subscription.Id -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity - -## OUTPUTS - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy - -## NOTES - -ALIASES - -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - - -EMISSIONPOLICIES : Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - -INGESTIONPOLICYINGESTIONSOURCES : Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - -INPUTOBJECT : Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - -PARAMETERS : Collection policy resource. - - `[EmissionPolicyList ]`: Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - - `[IngestionPolicyIngestionType ]`: The ingestion type. - -## RELATED LINKS - diff --git a/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollector.md deleted file mode 100644 index a2e3a600329c..000000000000 --- a/src/NetworkFunction/docs/Set-AzNetworkFunctionTrafficCollector.md +++ /dev/null @@ -1,307 +0,0 @@ ---- -external help file: -Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/set-aznetworkfunctiontrafficcollector -schema: 2.0.0 ---- - -# Set-AzNetworkFunctionTrafficCollector - -## SYNOPSIS -Creates or updates a Azure Traffic Collector resource - -## SYNTAX - -### UpdateExpanded (Default) -``` -Set-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location - [-SubscriptionId ] [-CollectorPolicyList ] [-Tags ] [-AsJob] [-NoWait] - [-Confirm] [-WhatIf] [] -``` - -### Update -``` -Set-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName - -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] - [] -``` - -### UpdateViaIdentity -``` -Set-AzNetworkFunctionTrafficCollector -InputObject - -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -### UpdateViaIdentityExpanded -``` -Set-AzNetworkFunctionTrafficCollector -InputObject -Location - [-CollectorPolicyList ] [-Tags ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] - [] -``` - -## DESCRIPTION -Creates or updates a Azure Traffic Collector resource - -## EXAMPLES - -### Example 1: Updates a traffic collector -```powershell -Set-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus -``` - -```output -{ - "CollectorPolicies": [], - "Etag": "testEtag", - "Id": "id", - "Location": "eastus", - "Name": "atctestps", - "ProvisioningState": {}, - "Tags": {}, - "Type": "Microsoft.NetworkFunction/AzureTrafficCollectors", - "VirtualHubId": null -} -``` - -This cmdlet updates a traffic collector. - -## PARAMETERS - -### -AsJob -Run the command as a job - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -CollectorPolicyList -Collector Policies for Azure Traffic Collector. -To construct, see NOTES section for COLLECTORPOLICIES properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy[] -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity -Parameter Sets: UpdateViaIdentity, UpdateViaIdentityExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -Location -Resource location. - -```yaml -Type: System.String -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Name -Azure Traffic Collector name - -```yaml -Type: System.String -Parameter Sets: Update, UpdateExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -NoWait -Run the command asynchronously - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Parameters -Azure Traffic Collector resource. -To construct, see NOTES section for PARAMETERS properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector -Parameter Sets: Update, UpdateViaIdentity -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -ResourceGroupName -The name of the resource group. - -```yaml -Type: System.String -Parameter Sets: Update, UpdateExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SubscriptionId -Azure Subscription ID. - -```yaml -Type: System.String -Parameter Sets: Update, UpdateExpanded -Aliases: - -Required: False -Position: Named -Default value: (Get-AzContext).Subscription.Id -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Tags -Resource tags. - -```yaml -Type: System.Collections.Hashtable -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity - -## OUTPUTS - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector - -## NOTES - -ALIASES - -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - - -COLLECTORPOLICIES : Collector Policies for Azure Traffic Collector. - - `[EmissionPolicyList ]`: Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - - `[IngestionPolicyIngestionType ]`: The ingestion type. - -INPUTOBJECT : Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - -PARAMETERS : Azure Traffic Collector resource. - - `[Location ]`: Resource location. - - `[Tags ]`: Resource tags. - - `[(Any) ]`: This indicates any property can be added to this object. - - `[CollectorPolicyList ]`: Collector Policies for Azure Traffic Collector. - - `[EmissionPolicyList ]`: Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - - `[IngestionPolicyIngestionType ]`: The ingestion type. - -## RELATED LINKS - diff --git a/src/NetworkFunction/examples/Set-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/examples/Set-AzNetworkFunctionCollectorPolicy.md deleted file mode 100644 index 081aba39191b..000000000000 --- a/src/NetworkFunction/examples/Set-AzNetworkFunctionCollectorPolicy.md +++ /dev/null @@ -1,38 +0,0 @@ -### Example 1: Update a traffic collector policy -```powershell -Set-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus -``` - -```output -{ - "name": "cp1", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/AzureTrafficCollector/atc/collectorPolicies/cp1", - "etag": "test", - "type": "Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies", - "properties": { - "ingestionPolicy": { - "ingestionType": "IPFIX", - "ingestionSources": [ - { - "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", - "sourceType": "Resource" - } - ] - }, - "emissionPolicies": [ - { - "emissionType": "IPFIX", - "emissionDestinations": [ - { - "destinationType": "AzureMonitor" - } - ] - } - ], - "provisioningState": "Succeeded" - } - } -} -``` - -This cmdlet updates a traffic collector policy. diff --git a/src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollector.md deleted file mode 100644 index c5f683e5917b..000000000000 --- a/src/NetworkFunction/examples/Set-AzNetworkFunctionTrafficCollector.md +++ /dev/null @@ -1,20 +0,0 @@ -### Example 1: Updates a traffic collector -```powershell -Set-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus -``` - -```output -{ - "CollectorPolicies": [], - "Etag": "testEtag", - "Id": "id", - "Location": "eastus", - "Name": "atctestps", - "ProvisioningState": {}, - "Tags": {}, - "Type": "Microsoft.NetworkFunction/AzureTrafficCollectors", - "VirtualHubId": null -} -``` - -This cmdlet updates a traffic collector. \ No newline at end of file diff --git a/src/NetworkFunction/test/Set-AzNetworkFunctionCollectorPolicy.Tests.ps1 b/src/NetworkFunction/test/Set-AzNetworkFunctionCollectorPolicy.Tests.ps1 deleted file mode 100644 index 01f2ae490b2d..000000000000 --- a/src/NetworkFunction/test/Set-AzNetworkFunctionCollectorPolicy.Tests.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -if(($null -eq $TestName) -or ($TestName -contains 'Set-AzNetworkFunctionCollectorPolicy')) -{ - $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' - if (-Not (Test-Path -Path $loadEnvPath)) { - $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' - } - . ($loadEnvPath) - $TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzNetworkFunctionCollectorPolicy.Recording.json' - $currentPath = $PSScriptRoot - while(-not $mockingPath) { - $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File - $currentPath = Split-Path -Path $currentPath -Parent - } - . ($mockingPath | Select-Object -First 1).FullName -} - -Describe 'Set-AzNetworkFunctionCollectorPolicy' { - It 'UpdateExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'Update' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'UpdateViaIdentityExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'UpdateViaIdentity' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } -} diff --git a/src/NetworkFunction/test/Set-AzNetworkFunctionTrafficCollector.Tests.ps1 b/src/NetworkFunction/test/Set-AzNetworkFunctionTrafficCollector.Tests.ps1 deleted file mode 100644 index a8272f9d88cf..000000000000 --- a/src/NetworkFunction/test/Set-AzNetworkFunctionTrafficCollector.Tests.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -if(($null -eq $TestName) -or ($TestName -contains 'Set-AzNetworkFunctionTrafficCollector')) -{ - $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' - if (-Not (Test-Path -Path $loadEnvPath)) { - $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' - } - . ($loadEnvPath) - $TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzNetworkFunctionTrafficCollector.Recording.json' - $currentPath = $PSScriptRoot - while(-not $mockingPath) { - $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File - $currentPath = Split-Path -Path $currentPath -Parent - } - . ($mockingPath | Select-Object -First 1).FullName -} - -Describe 'Set-AzNetworkFunctionTrafficCollector' { - It 'UpdateExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'Update' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'UpdateViaIdentityExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'UpdateViaIdentity' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } -} From 13c6c8e049aaa61e6d1f9ecfc180fa20bde5930d Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Fri, 5 Aug 2022 09:55:09 -0700 Subject: [PATCH 26/28] Added update cmdlet --- src/NetworkFunction/custom/README.md | 41 ++ ...pdate-AzNetworkFunctionCollectorPolicy.ps1 | 174 +++++++++ ...date-AzNetworkFunctionTrafficCollector.ps1 | 163 ++++++++ ...Update-AzNetworkFunctionCollectorPolicy.md | 354 ++++++++++++++++++ ...pdate-AzNetworkFunctionTrafficCollector.md | 306 +++++++++++++++ ...Update-AzNetworkFunctionCollectorPolicy.md | 38 ++ ...pdate-AzNetworkFunctionTrafficCollector.md | 20 + ...AzNetworkFunctionCollectorPolicy.Tests.ps1 | 21 ++ ...zNetworkFunctionTrafficCollector.Tests.ps1 | 21 ++ 9 files changed, 1138 insertions(+) create mode 100644 src/NetworkFunction/custom/README.md create mode 100644 src/NetworkFunction/custom/Update-AzNetworkFunctionCollectorPolicy.ps1 create mode 100644 src/NetworkFunction/custom/Update-AzNetworkFunctionTrafficCollector.ps1 create mode 100644 src/NetworkFunction/docs/Update-AzNetworkFunctionCollectorPolicy.md create mode 100644 src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollector.md create mode 100644 src/NetworkFunction/examples/Update-AzNetworkFunctionCollectorPolicy.md create mode 100644 src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollector.md create mode 100644 src/NetworkFunction/test/Update-AzNetworkFunctionCollectorPolicy.Tests.ps1 create mode 100644 src/NetworkFunction/test/Update-AzNetworkFunctionTrafficCollector.Tests.ps1 diff --git a/src/NetworkFunction/custom/README.md b/src/NetworkFunction/custom/README.md new file mode 100644 index 000000000000..b215827d31cd --- /dev/null +++ b/src/NetworkFunction/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.NetworkFunction` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.NetworkFunction.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.NetworkFunction` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.NetworkFunction.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.NetworkFunction.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.NetworkFunction`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.NetworkFunction`. +- `Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.NetworkFunction`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/src/NetworkFunction/custom/Update-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/custom/Update-AzNetworkFunctionCollectorPolicy.ps1 new file mode 100644 index 000000000000..56ffbb44aa46 --- /dev/null +++ b/src/NetworkFunction/custom/Update-AzNetworkFunctionCollectorPolicy.ps1 @@ -0,0 +1,174 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a Collector Policy resource +.Description +Creates or updates a Collector Policy resource +.Example +{{ Add code here }} +.Example +{{ Add code here }} +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy +.Notes +COMPLEX PARAMETER PROPERTIES +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +EMISSIONPOLICY : Emission policies. + [EmissionDestination ]: Emission policy destinations. + [DestinationType ]: Emission destination type. + [EmissionType ]: Emission format type. +INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. + [ResourceId ]: Resource ID. + [SourceType ]: Ingestion source type. +.Link +https://docs.microsoft.com/powershell/module/az.networkfunction/set-aznetworkfunctioncollectorpolicy +#> +function Update-AzNetworkFunctionCollectorPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${AzureTrafficCollectorName}, + + [Parameter(Mandatory)] + [Alias('CollectorPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Collector Policy Name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IEmissionPoliciesPropertiesFormat[]] + # Emission policies. + # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. + ${EmissionPolicy}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IIngestionSourcesPropertiesFormat[]] + # Ingestion Sources. + # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. + ${IngestionPolicyIngestionSource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType] + # The ingestion type. + ${IngestionPolicyIngestionType}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +process { + try { + Az.NetworkFunction.internal\Set-AzNetworkFunctionCollectorPolicy @PSBoundParameters + } catch { + throw + } +} +} \ No newline at end of file diff --git a/src/NetworkFunction/custom/Update-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/custom/Update-AzNetworkFunctionTrafficCollector.ps1 new file mode 100644 index 000000000000..1c826060f80e --- /dev/null +++ b/src/NetworkFunction/custom/Update-AzNetworkFunctionTrafficCollector.ps1 @@ -0,0 +1,163 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a Azure Traffic Collector resource +.Description +Creates or updates a Azure Traffic Collector resource +.Example +{{ Add code here }} +.Example +{{ Add code here }} +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector +.Notes +COMPLEX PARAMETER PROPERTIES +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +COLLECTORPOLICY : Collector Policies for Azure Traffic Collector. + [Location ]: Resource location. + [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). + [SystemDataCreatedBy ]: The identity that created the resource. + [SystemDataCreatedByType ]: The type of identity that created the resource. + [SystemDataLastModifiedBy ]: The identity that last modified the resource. + [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. + [Tag ]: Resource tags. + [(Any) ]: This indicates any property can be added to this object. + [EmissionPolicy ]: Emission policies. + [EmissionDestination ]: Emission policy destinations. + [DestinationType ]: Emission destination type. + [EmissionType ]: Emission format type. + [IngestionPolicyIngestionSource ]: Ingestion Sources. + [ResourceId ]: Resource ID. + [SourceType ]: Ingestion source type. + [IngestionPolicyIngestionType ]: The ingestion type. +.Link +https://docs.microsoft.com/powershell/module/az.networkfunction/set-aznetworkfunctiontrafficcollector +#> +function Update-AzNetworkFunctionTrafficCollector { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector])] + [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory)] + [Alias('AzureTrafficCollectorName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy[]] + # Collector Policies for Azure Traffic Collector. + # To construct, see NOTES section for COLLECTORPOLICY properties and create a hash table. + ${CollectorPolicy}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + try { + Az.NetworkFunction.internal\Set-AzNetworkFunctionTrafficCollector @PSBoundParameters + } catch { + throw + } + } + } \ No newline at end of file diff --git a/src/NetworkFunction/docs/Update-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/docs/Update-AzNetworkFunctionCollectorPolicy.md new file mode 100644 index 000000000000..65e707430d44 --- /dev/null +++ b/src/NetworkFunction/docs/Update-AzNetworkFunctionCollectorPolicy.md @@ -0,0 +1,354 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/set-aznetworkfunctioncollectorpolicy +schema: 2.0.0 +--- + +# Update-AzNetworkFunctionCollectorPolicy + +## SYNOPSIS +Creates or updates a Collector Policy resource + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName + -ResourceGroupName -Location [-SubscriptionId ] + [-EmissionPolicyList ] + [-IngestionPolicyIngestionSourceList ] + [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### Update +``` +Update-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName + -ResourceGroupName -Location -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentity +``` +Update-AzNetworkFunctionCollectorPolicy -InputObject + -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzNetworkFunctionCollectorPolicy -InputObject + [-EmissionPolicyList ] + [-IngestionPolicyIngestionSourceList ] + [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a Collector Policy resource + +## EXAMPLES + +### Example 1: Update a traffic collector policy +```powershell +Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus +``` + +```output +{ + "name": "cp1", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/AzureTrafficCollector/atc/collectorPolicies/cp1", + "etag": "test", + "type": "Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies", + "properties": { + "ingestionPolicy": { + "ingestionType": "IPFIX", + "ingestionSources": [ + { + "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", + "sourceType": "Resource" + } + ] + }, + "emissionPolicies": [ + { + "emissionType": "IPFIX", + "emissionDestinations": [ + { + "destinationType": "AzureMonitor" + } + ] + } + ], + "provisioningState": "Succeeded" + } + } +} +``` + +This cmdlet updates a traffic collector policy. + + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureTrafficCollectorName +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: Update, UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CollectorPolicyName +Collector Policy Name + +```yaml +Type: System.String +Parameter Sets: Update, UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EmissionPolicyList +Emission policies. +To construct, see NOTES section for EMISSIONPOLICIES properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IEmissionPoliciesPropertiesFormat[] +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionPolicyIngestionSourceList +Ingestion Sources. +To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCES properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IIngestionSourcesPropertiesFormat[] +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionPolicyIngestionType +The ingestion type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +Parameter Sets: UpdateViaIdentity, UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameters +Collection policy resource. +To construct, see NOTES section for PARAMETERS properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy +Parameter Sets: Update, UpdateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: Update, UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: Update, UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +EMISSIONPOLICIES : Emission policies. + - `[EmissionDestinations ]`: Emission policy destinations. + - `[DestinationType ]`: Emission destination type. + - `[EmissionType ]`: Emission format type. + +INGESTIONPOLICYINGESTIONSOURCES : Ingestion Sources. + - `[ResourceId ]`: Resource ID. + - `[SourceType ]`: Ingestion source type. + +INPUTOBJECT : Identity Parameter + - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name + - `[CollectorPolicyName ]`: Collector Policy Name + - `[ResourceGroupName ]`: The name of the resource group. + - `[SubscriptionId ]`: Azure Subscription ID. + +PARAMETERS : Collection policy resource. + - `[EmissionPolicyList ]`: Emission policies. + - `[EmissionDestinations ]`: Emission policy destinations. + - `[DestinationType ]`: Emission destination type. + - `[EmissionType ]`: Emission format type. + - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. + - `[ResourceId ]`: Resource ID. + - `[SourceType ]`: Ingestion source type. + - `[IngestionPolicyIngestionType ]`: The ingestion type. + +## RELATED LINKS diff --git a/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollector.md new file mode 100644 index 000000000000..9bd0d9fb7f3f --- /dev/null +++ b/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollector.md @@ -0,0 +1,306 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/set-aznetworkfunctiontrafficcollector +schema: 2.0.0 +--- + +# Update-AzNetworkFunctionTrafficCollector + +## SYNOPSIS +Creates or updates a Azure Traffic Collector resource + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location + [-SubscriptionId ] [-CollectorPolicyList ] [-Tags ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +### Update +``` +Update-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location + -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentity +``` +Update-AzNetworkFunctionTrafficCollector -InputObject + -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzNetworkFunctionTrafficCollector -InputObject -Location + [-CollectorPolicyList ] [-Tags ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Creates or updates a Azure Traffic Collector resource + +## EXAMPLES + +### Example 1: Updates a traffic collector +```powershell +Update-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus +``` + +```output +{ + "CollectorPolicies": [], + "Etag": "testEtag", + "Id": "id", + "Location": "eastus", + "Name": "atctestps", + "ProvisioningState": {}, + "Tags": {}, + "Type": "Microsoft.NetworkFunction/AzureTrafficCollectors", + "VirtualHubId": null +} +``` + +This cmdlet updates a traffic collector. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CollectorPolicyList +Collector Policies for Azure Traffic Collector. +To construct, see NOTES section for COLLECTORPOLICIES properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy[] +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +Parameter Sets: UpdateViaIdentity, UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: Update, UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameters +Azure Traffic Collector resource. +To construct, see NOTES section for PARAMETERS properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector +Parameter Sets: Update, UpdateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: Update, UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: Update, UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tags +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +COLLECTORPOLICIES : Collector Policies for Azure Traffic Collector. + - `[EmissionPolicyList ]`: Emission policies. + - `[EmissionDestinations ]`: Emission policy destinations. + - `[DestinationType ]`: Emission destination type. + - `[EmissionType ]`: Emission format type. + - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. + - `[ResourceId ]`: Resource ID. + - `[SourceType ]`: Ingestion source type. + - `[IngestionPolicyIngestionType ]`: The ingestion type. + +INPUTOBJECT : Identity Parameter + - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name + - `[CollectorPolicyName ]`: Collector Policy Name + - `[ResourceGroupName ]`: The name of the resource group. + - `[SubscriptionId ]`: Azure Subscription ID. + +PARAMETERS : Azure Traffic Collector resource. + - `[Location ]`: Resource location. + - `[Tags ]`: Resource tags. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[CollectorPolicyList ]`: Collector Policies for Azure Traffic Collector. + - `[EmissionPolicyList ]`: Emission policies. + - `[EmissionDestinations ]`: Emission policy destinations. + - `[DestinationType ]`: Emission destination type. + - `[EmissionType ]`: Emission format type. + - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. + - `[ResourceId ]`: Resource ID. + - `[SourceType ]`: Ingestion source type. + - `[IngestionPolicyIngestionType ]`: The ingestion type. + +## RELATED LINKS diff --git a/src/NetworkFunction/examples/Update-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/examples/Update-AzNetworkFunctionCollectorPolicy.md new file mode 100644 index 000000000000..f7a51ccddee9 --- /dev/null +++ b/src/NetworkFunction/examples/Update-AzNetworkFunctionCollectorPolicy.md @@ -0,0 +1,38 @@ +### Example 1: Update a traffic collector policy +```powershell +Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus +``` + +```output +{ + "name": "cp1", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/AzureTrafficCollector/atc/collectorPolicies/cp1", + "etag": "test", + "type": "Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies", + "properties": { + "ingestionPolicy": { + "ingestionType": "IPFIX", + "ingestionSources": [ + { + "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", + "sourceType": "Resource" + } + ] + }, + "emissionPolicies": [ + { + "emissionType": "IPFIX", + "emissionDestinations": [ + { + "destinationType": "AzureMonitor" + } + ] + } + ], + "provisioningState": "Succeeded" + } + } +} +``` + +This cmdlet updates a traffic collector policy. \ No newline at end of file diff --git a/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollector.md new file mode 100644 index 000000000000..f3a8f30dd637 --- /dev/null +++ b/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollector.md @@ -0,0 +1,20 @@ +### Example 1: Updates a traffic collector +```powershell +Update-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus +``` + +```output +{ + "CollectorPolicies": [], + "Etag": "testEtag", + "Id": "id", + "Location": "eastus", + "Name": "atctestps", + "ProvisioningState": {}, + "Tags": {}, + "Type": "Microsoft.NetworkFunction/AzureTrafficCollectors", + "VirtualHubId": null +} +``` + +This cmdlet updates a traffic collector. \ No newline at end of file diff --git a/src/NetworkFunction/test/Update-AzNetworkFunctionCollectorPolicy.Tests.ps1 b/src/NetworkFunction/test/Update-AzNetworkFunctionCollectorPolicy.Tests.ps1 new file mode 100644 index 000000000000..ec1a10585699 --- /dev/null +++ b/src/NetworkFunction/test/Update-AzNetworkFunctionCollectorPolicy.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzNetworkFunctionCollectorPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzNetworkFunctionCollectorPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzNetworkFunctionCollectorPolicy' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/NetworkFunction/test/Update-AzNetworkFunctionTrafficCollector.Tests.ps1 b/src/NetworkFunction/test/Update-AzNetworkFunctionTrafficCollector.Tests.ps1 new file mode 100644 index 000000000000..ae192f704216 --- /dev/null +++ b/src/NetworkFunction/test/Update-AzNetworkFunctionTrafficCollector.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzNetworkFunctionTrafficCollector')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzNetworkFunctionTrafficCollector.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzNetworkFunctionTrafficCollector' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} From b4a799b229654c9c46ddba697e366d76da9d04e5 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Fri, 12 Aug 2022 11:13:57 -0700 Subject: [PATCH 27/28] updated examples --- .../examples/Get-AzNetworkFunctionCollectorPolicy.md | 2 +- .../examples/Get-AzNetworkFunctionTrafficCollector.md | 4 ++-- .../examples/New-AzNetworkFunctionCollectorPolicy.md | 4 ++-- .../examples/New-AzNetworkFunctionTrafficCollector.md | 4 ++-- .../examples/Remove-AzNetworkFunctionCollectorPolicy.md | 2 +- .../examples/Remove-AzNetworkFunctionTrafficCollector.md | 2 +- .../examples/Update-AzNetworkFunctionCollectorPolicy.md | 2 +- .../examples/Update-AzNetworkFunctionTrafficCollector.md | 2 +- .../examples/Update-AzNetworkFunctionTrafficCollectorTag.md | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/NetworkFunction/examples/Get-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/examples/Get-AzNetworkFunctionCollectorPolicy.md index 3bbdbd94cf52..91d8267561d3 100644 --- a/src/NetworkFunction/examples/Get-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/examples/Get-AzNetworkFunctionCollectorPolicy.md @@ -1,6 +1,6 @@ ### Example 1: Get list of collector policies by atc name and resource group ```powershell -Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName test -resourcegroup test +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName test -resourcegroupname test ``` ```output diff --git a/src/NetworkFunction/examples/Get-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/examples/Get-AzNetworkFunctionTrafficCollector.md index 6195be1d971a..6de74b1de197 100644 --- a/src/NetworkFunction/examples/Get-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/examples/Get-AzNetworkFunctionTrafficCollector.md @@ -23,7 +23,7 @@ This cmdlet gets list of traffic collectors in selected subscription. ### Example 2: Get list of traffic collectors by resource group ```powershell -Get-AzNetworkFunctionTrafficCollector -ResourceGroup test +Get-AzNetworkFunctionTrafficCollector -ResourceGroupName test ``` ```output @@ -46,7 +46,7 @@ This cmdlet gets list of traffic collectors by resource group. ### Example 3: Get list of traffic collectors by name ```powershell -Get-AzNetworkFunctionTrafficCollector -ResourceGroup test -name test +Get-AzNetworkFunctionTrafficCollector -ResourceGroupName test -name test ``` ```output diff --git a/src/NetworkFunction/examples/New-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/examples/New-AzNetworkFunctionCollectorPolicy.md index 66b8074437cf..fc004edd9d6f 100644 --- a/src/NetworkFunction/examples/New-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/examples/New-AzNetworkFunctionCollectorPolicy.md @@ -1,6 +1,6 @@ ### Example 1: Create a new traffic collector policy ```powershell -New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus +New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 -location eastus ``` ```output @@ -35,4 +35,4 @@ New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcolle } ``` -This cmdlet creates a new traffic collector policy. +This cmdlet creates a new traffic collector policy. \ No newline at end of file diff --git a/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollector.md index 4bddbaca942f..be74169f49ae 100644 --- a/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/examples/New-AzNetworkFunctionTrafficCollector.md @@ -1,6 +1,6 @@ ### Example 1: Create a new traffic collector ```powershell -New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus +New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname test -location eastus ``` ```output @@ -17,4 +17,4 @@ New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -locat } ``` -This cmdlet creates a new traffic collector. +This cmdlet creates a new traffic collector. \ No newline at end of file diff --git a/src/NetworkFunction/examples/Remove-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/examples/Remove-AzNetworkFunctionCollectorPolicy.md index e3667d3bf45b..7d263e2eb772 100644 --- a/src/NetworkFunction/examples/Remove-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/examples/Remove-AzNetworkFunctionCollectorPolicy.md @@ -1,6 +1,6 @@ ### Example 1: Delete a new traffic collector policy ```powershell -Remove-AzNetworkFunctionCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroup test +Remove-AzNetworkFunctionCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroupname test ``` ```output diff --git a/src/NetworkFunction/examples/Remove-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/examples/Remove-AzNetworkFunctionTrafficCollector.md index 73058c5b33eb..43b5fe8bdb54 100644 --- a/src/NetworkFunction/examples/Remove-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/examples/Remove-AzNetworkFunctionTrafficCollector.md @@ -1,6 +1,6 @@ ### Example 1: Delete a new traffic collector ```powershell -Remove-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup SEA-Cust10 +Remove-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname SEA-Cust10 ``` ```output diff --git a/src/NetworkFunction/examples/Update-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/examples/Update-AzNetworkFunctionCollectorPolicy.md index f7a51ccddee9..0363ecb28828 100644 --- a/src/NetworkFunction/examples/Update-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/examples/Update-AzNetworkFunctionCollectorPolicy.md @@ -1,6 +1,6 @@ ### Example 1: Update a traffic collector policy ```powershell -Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus +Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 -location eastus ``` ```output diff --git a/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollector.md index f3a8f30dd637..028ca13840b4 100644 --- a/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollector.md @@ -1,6 +1,6 @@ ### Example 1: Updates a traffic collector ```powershell -Update-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus +Update-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname test -location eastus ``` ```output diff --git a/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollectorTag.md b/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollectorTag.md index a575276e0e28..6c0b9267ce14 100644 --- a/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollectorTag.md +++ b/src/NetworkFunction/examples/Update-AzNetworkFunctionTrafficCollectorTag.md @@ -1,6 +1,6 @@ ### Example 1: Updates a traffic collector tag ```powershell -Update-AzNetworkFunctionTrafficCollectorTag -azuretrafficcollectorname atc -resourcegroup rg1 +Update-AzNetworkFunctionTrafficCollectorTag -azuretrafficcollectorname atc -resourcegroupname rg1 ``` ```output From dae6e1c2ac527e122c1b00793ea97cba1aa6e7d0 Mon Sep 17 00:00:00 2001 From: Kunal Kulkarni Date: Fri, 12 Aug 2022 11:42:16 -0700 Subject: [PATCH 28/28] updating docs folder --- .../docs/Az.NetworkFunction.md | 24 +-- .../Get-AzNetworkFunctionCollectorPolicy.md | 51 ++++-- .../Get-AzNetworkFunctionTrafficCollector.md | 38 ++-- .../New-AzNetworkFunctionCollectorPolicy.md | 161 +++++++---------- .../New-AzNetworkFunctionTrafficCollector.md | 125 ++++---------- ...Remove-AzNetworkFunctionCollectorPolicy.md | 46 +++-- ...emove-AzNetworkFunctionTrafficCollector.md | 35 ++-- ...Update-AzNetworkFunctionCollectorPolicy.md | 163 +++++++----------- ...pdate-AzNetworkFunctionTrafficCollector.md | 125 ++++---------- ...te-AzNetworkFunctionTrafficCollectorTag.md | 71 +++----- 10 files changed, 342 insertions(+), 497 deletions(-) diff --git a/src/NetworkFunction/docs/Az.NetworkFunction.md b/src/NetworkFunction/docs/Az.NetworkFunction.md index 12ed835af16f..02e233375d51 100644 --- a/src/NetworkFunction/docs/Az.NetworkFunction.md +++ b/src/NetworkFunction/docs/Az.NetworkFunction.md @@ -1,40 +1,40 @@ --- Module Name: Az.NetworkFunction Module Guid: 1d339b1c-5a86-4fbd-9a2e-d0497c39b397 -Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction +Download Help Link: https://docs.microsoft.com/powershell/module/az.networkfunction Help Version: 1.0.0.0 Locale: en-US --- # Az.NetworkFunction Module ## Description - +Microsoft Azure PowerShell: NetworkFunction cmdlets ## Az.NetworkFunction Cmdlets +### [Get-AzNetworkFunctionCollectorPolicy](Get-AzNetworkFunctionCollectorPolicy.md) +Gets the collector policy in a specified Traffic Collector + ### [Get-AzNetworkFunctionTrafficCollector](Get-AzNetworkFunctionTrafficCollector.md) Gets the specified Azure Traffic Collector in a specified resource group -### [Get-AzNetworkFunctionTrafficCollectorPolicy](Get-AzNetworkFunctionTrafficCollectorPolicy.md) -Gets the collector policy in a specified Traffic Collector +### [New-AzNetworkFunctionCollectorPolicy](New-AzNetworkFunctionCollectorPolicy.md) +Creates or updates a Collector Policy resource ### [New-AzNetworkFunctionTrafficCollector](New-AzNetworkFunctionTrafficCollector.md) Creates or updates a Azure Traffic Collector resource -### [New-AzNetworkFunctionTrafficCollectorPolicy](New-AzNetworkFunctionTrafficCollectorPolicy.md) -Creates or updates a Collector Policy resource +### [Remove-AzNetworkFunctionCollectorPolicy](Remove-AzNetworkFunctionCollectorPolicy.md) +Deletes a specified Collector Policy resource. ### [Remove-AzNetworkFunctionTrafficCollector](Remove-AzNetworkFunctionTrafficCollector.md) Deletes a specified Azure Traffic Collector resource. -### [Remove-AzNetworkFunctionTrafficCollectorPolicy](Remove-AzNetworkFunctionTrafficCollectorPolicy.md) -Deletes a specified Collector Policy resource. +### [Update-AzNetworkFunctionCollectorPolicy](Update-AzNetworkFunctionCollectorPolicy.md) +Creates or updates a Collector Policy resource -### [Set-AzNetworkFunctionTrafficCollector](Set-AzNetworkFunctionTrafficCollector.md) +### [Update-AzNetworkFunctionTrafficCollector](Update-AzNetworkFunctionTrafficCollector.md) Creates or updates a Azure Traffic Collector resource -### [Set-AzNetworkFunctionTrafficCollectorPolicy](Set-AzNetworkFunctionTrafficCollectorPolicy.md) -Creates or updates a Collector Policy resource - ### [Update-AzNetworkFunctionTrafficCollectorTag](Update-AzNetworkFunctionTrafficCollectorTag.md) Updates the specified Azure Traffic Collector tags. diff --git a/src/NetworkFunction/docs/Get-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/docs/Get-AzNetworkFunctionCollectorPolicy.md index a1b44dc1a538..2b7d34571848 100644 --- a/src/NetworkFunction/docs/Get-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/docs/Get-AzNetworkFunctionCollectorPolicy.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/get-aznetworkfunctioncollectorpolicy +online version: https://docs.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctioncollectorpolicy schema: 2.0.0 --- @@ -15,18 +15,19 @@ Gets the collector policy in a specified Traffic Collector ### List (Default) ``` Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -ResourceGroupName - [-SubscriptionId ] [] + [-SubscriptionId ] [-DefaultProfile ] [] ``` ### Get ``` -Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName - -ResourceGroupName [-SubscriptionId ] [] +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] ``` ### GetViaIdentity ``` -Get-AzNetworkFunctionCollectorPolicy -InputObject [] +Get-AzNetworkFunctionCollectorPolicy -InputObject [-DefaultProfile ] + [] ``` ## DESCRIPTION @@ -36,7 +37,7 @@ Gets the collector policy in a specified Traffic Collector ### Example 1: Get list of collector policies by atc name and resource group ```powershell -Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName test -resourcegroup test +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName test -resourcegroupname test ``` ```output @@ -90,15 +91,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -CollectorPolicyName -Collector Policy Name +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: System.String -Parameter Sets: Get -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -110,7 +111,7 @@ Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity Parameter Sets: GetViaIdentity Aliases: @@ -121,6 +122,21 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` +### -Name +Collector Policy Name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: CollectorPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -140,7 +156,7 @@ Accept wildcard characters: False Azure Subscription ID. ```yaml -Type: System.String +Type: System.String[] Parameter Sets: Get, List Aliases: @@ -156,11 +172,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy ## NOTES @@ -171,9 +187,10 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - `[CollectorPolicyName ]`: Collector Policy Name + - `[Id ]`: Resource identity path - `[ResourceGroupName ]`: The name of the resource group. - `[SubscriptionId ]`: Azure Subscription ID. diff --git a/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollector.md index c84ef69e711a..de7a67f002f3 100644 --- a/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/docs/Get-AzNetworkFunctionTrafficCollector.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/get-aznetworkfunctiontrafficcollector +online version: https://docs.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctiontrafficcollector schema: 2.0.0 --- @@ -14,19 +14,26 @@ Gets the specified Azure Traffic Collector in a specified resource group ### List (Default) ``` -Get-AzNetworkFunctionTrafficCollector [-ResourceGroupName ] [-SubscriptionId ] +Get-AzNetworkFunctionTrafficCollector [-SubscriptionId ] [-DefaultProfile ] [] ``` ### Get ``` -Get-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName [-SubscriptionId ] +Get-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] ``` ### GetViaIdentity ``` -Get-AzNetworkFunctionTrafficCollector -InputObject [] +Get-AzNetworkFunctionTrafficCollector -InputObject [-DefaultProfile ] + [] +``` + +### List1 +``` +Get-AzNetworkFunctionTrafficCollector -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] ``` ## DESCRIPTION @@ -59,7 +66,7 @@ This cmdlet gets list of traffic collectors in selected subscription. ### Example 2: Get list of traffic collectors by resource group ```powershell -Get-AzNetworkFunctionTrafficCollector -ResourceGroup test +Get-AzNetworkFunctionTrafficCollector -ResourceGroupName test ``` ```output @@ -82,7 +89,7 @@ This cmdlet gets list of traffic collectors by resource group. ### Example 3: Get list of traffic collectors by name ```powershell -Get-AzNetworkFunctionTrafficCollector -ResourceGroup test -name test +Get-AzNetworkFunctionTrafficCollector -ResourceGroupName test -name test ``` ```output @@ -111,7 +118,7 @@ The credentials, account, tenant, and subscription used for communication with A ```yaml Type: System.Management.Automation.PSObject -Parameter Sets: Get +Parameter Sets: (All) Aliases: AzureRMContext, AzureCredential Required: False @@ -126,7 +133,7 @@ Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity Parameter Sets: GetViaIdentity Aliases: @@ -143,7 +150,7 @@ Azure Traffic Collector name ```yaml Type: System.String Parameter Sets: Get -Aliases: +Aliases: AzureTrafficCollectorName Required: True Position: Named @@ -157,7 +164,7 @@ The name of the resource group. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: Get, List1 Aliases: Required: True @@ -171,8 +178,8 @@ Accept wildcard characters: False Azure Subscription ID. ```yaml -Type: System.String -Parameter Sets: Get, List +Type: System.String[] +Parameter Sets: Get, List, List1 Aliases: Required: False @@ -187,11 +194,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector ## NOTES @@ -202,9 +209,10 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - `[CollectorPolicyName ]`: Collector Policy Name + - `[Id ]`: Resource identity path - `[ResourceGroupName ]`: The name of the resource group. - `[SubscriptionId ]`: Azure Subscription ID. diff --git a/src/NetworkFunction/docs/New-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/docs/New-AzNetworkFunctionCollectorPolicy.md index 669fc24e0fe3..348e32982b99 100644 --- a/src/NetworkFunction/docs/New-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/docs/New-AzNetworkFunctionCollectorPolicy.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy +online version: https://docs.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy schema: 2.0.0 --- @@ -12,34 +12,13 @@ Creates or updates a Collector Policy resource ## SYNTAX -### CreateExpanded (Default) ``` -New-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName +New-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name -ResourceGroupName -Location [-SubscriptionId ] - [-EmissionPolicyList ] - [-IngestionPolicyIngestionSourceList ] - [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -### Create -``` -New-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName - -ResourceGroupName -Location -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] - [-Confirm] [-WhatIf] [] -``` - -### CreateViaIdentity -``` -New-AzNetworkFunctionCollectorPolicy -InputObject - -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -### CreateViaIdentityExpanded -``` -New-AzNetworkFunctionCollectorPolicy -InputObject - [-EmissionPolicyList ] - [-IngestionPolicyIngestionSourceList ] - [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] + [-EmissionPolicy ] + [-IngestionPolicyIngestionSource ] + [-IngestionPolicyIngestionType ] [-Tag ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION @@ -49,7 +28,7 @@ Creates or updates a Collector Policy resource ### Example 1: Create a new traffic collector policy ```powershell -New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus +New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 -location eastus ``` ```output @@ -108,7 +87,7 @@ Azure Traffic Collector name ```yaml Type: System.String -Parameter Sets: Create, CreateExpanded +Parameter Sets: (All) Aliases: Required: True @@ -118,43 +97,44 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -CollectorPolicyName -Collector Policy Name +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: System.String -Parameter Sets: Create, CreateExpanded -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -Location -Resource location. +### -EmissionPolicy +Emission policies. +To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. ```yaml -Type: System.String -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IEmissionPoliciesPropertiesFormat[] +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -EmissionPolicyList -Emission policies. -To construct, see NOTES section for EMISSIONPOLICIES properties and create a hash table. +### -IngestionPolicyIngestionSource +Ingestion Sources. +To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IEmissionPoliciesPropertiesFormat[] -Parameter Sets: CreateExpanded, CreateViaIdentityExpanded +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IIngestionSourcesPropertiesFormat[] +Parameter Sets: (All) Aliases: Required: False @@ -164,13 +144,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IngestionPolicyIngestionSourceList -Ingestion Sources. -To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCES properties and create a hash table. +### -IngestionPolicyIngestionType +The ingestion type. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IIngestionSourcesPropertiesFormat[] -Parameter Sets: CreateExpanded, CreateViaIdentityExpanded +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType +Parameter Sets: (All) Aliases: Required: False @@ -180,34 +159,33 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IngestionPolicyIngestionType -The ingestion type. +### -Location +Resource location. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType -Parameter Sets: CreateExpanded, CreateViaIdentityExpanded +Type: System.String +Parameter Sets: (All) Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. +### -Name +Collector Policy Name ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity -Parameter Sets: CreateViaIdentity, CreateViaIdentityExpanded -Aliases: +Type: System.String +Parameter Sets: (All) +Aliases: CollectorPolicyName Required: True Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -226,48 +204,47 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Parameters -Collection policy resource. -To construct, see NOTES section for PARAMETERS properties and create a hash table. +### -ResourceGroupName +The name of the resource group. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy -Parameter Sets: Create, CreateViaIdentity +Type: System.String +Parameter Sets: (All) Aliases: Required: True Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceGroupName -The name of the resource group. +### -SubscriptionId +Azure Subscription ID. ```yaml Type: System.String -Parameter Sets: Create, CreateExpanded +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named -Default value: None +Default value: (Get-AzContext).Subscription.Id Accept pipeline input: False Accept wildcard characters: False ``` -### -SubscriptionId -Azure Subscription ID. +### -Tag +Resource tags. ```yaml -Type: System.String -Parameter Sets: Create, CreateExpanded +Type: System.Collections.Hashtable +Parameter Sets: (All) Aliases: Required: False Position: Named -Default value: (Get-AzContext).Subscription.Id +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -308,13 +285,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity - ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy ## NOTES @@ -325,30 +298,14 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -EMISSIONPOLICIES : Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. +EMISSIONPOLICY : Emission policies. + - `[EmissionDestination ]`: Emission policy destinations. - `[DestinationType ]`: Emission destination type. - `[EmissionType ]`: Emission format type. -INGESTIONPOLICYINGESTIONSOURCES : Ingestion Sources. +INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. - `[ResourceId ]`: Resource ID. - `[SourceType ]`: Ingestion source type. -INPUTOBJECT : Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - -PARAMETERS : Collection policy resource. - - `[EmissionPolicyList ]`: Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - - `[IngestionPolicyIngestionType ]`: The ingestion type. - ## RELATED LINKS diff --git a/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollector.md index 3adda8a286f0..f15076a038ca 100644 --- a/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/docs/New-AzNetworkFunctionTrafficCollector.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/new-aznetworkfunctiontrafficcollector +online version: https://docs.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctiontrafficcollector schema: 2.0.0 --- @@ -12,31 +12,10 @@ Creates or updates a Azure Traffic Collector resource ## SYNTAX -### CreateExpanded (Default) ``` New-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location - [-SubscriptionId ] [-CollectorPolicyList ] [-Tags ] [-AsJob] [-NoWait] - [-Confirm] [-WhatIf] [] -``` - -### Create -``` -New-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName - -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] - [] -``` - -### CreateViaIdentity -``` -New-AzNetworkFunctionTrafficCollector -InputObject - -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -### CreateViaIdentityExpanded -``` -New-AzNetworkFunctionTrafficCollector -InputObject -Location - [-CollectorPolicyList ] [-Tags ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] - [] + [-SubscriptionId ] [-CollectorPolicy ] [-Tag ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION @@ -46,7 +25,7 @@ Creates or updates a Azure Traffic Collector resource ### Example 1: Create a new traffic collector ```powershell -New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus +New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname test -location eastus ``` ```output @@ -65,7 +44,6 @@ New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -locat This cmdlet creates a new traffic collector. - ## PARAMETERS ### -AsJob @@ -83,13 +61,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -CollectorPolicyList +### -CollectorPolicy Collector Policies for Azure Traffic Collector. -To construct, see NOTES section for COLLECTORPOLICIES properties and create a hash table. +To construct, see NOTES section for COLLECTORPOLICY properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy[] -Parameter Sets: CreateExpanded, CreateViaIdentityExpanded +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy[] +Parameter Sets: (All) Aliases: Required: False @@ -99,19 +77,18 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity -Parameter Sets: CreateViaIdentity, CreateViaIdentityExpanded -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -120,7 +97,7 @@ Resource location. ```yaml Type: System.String -Parameter Sets: CreateExpanded, CreateViaIdentityExpanded +Parameter Sets: (All) Aliases: Required: True @@ -135,8 +112,8 @@ Azure Traffic Collector name ```yaml Type: System.String -Parameter Sets: Create, CreateExpanded -Aliases: +Parameter Sets: (All) +Aliases: AzureTrafficCollectorName Required: True Position: Named @@ -160,28 +137,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Parameters -Azure Traffic Collector resource. -To construct, see NOTES section for PARAMETERS properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector -Parameter Sets: Create, CreateViaIdentity -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -ResourceGroupName The name of the resource group. ```yaml Type: System.String -Parameter Sets: Create, CreateExpanded +Parameter Sets: (All) Aliases: Required: True @@ -196,7 +157,7 @@ Azure Subscription ID. ```yaml Type: System.String -Parameter Sets: Create, CreateExpanded +Parameter Sets: (All) Aliases: Required: False @@ -206,12 +167,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Tags +### -Tag Resource tags. ```yaml Type: System.Collections.Hashtable -Parameter Sets: CreateExpanded, CreateViaIdentityExpanded +Parameter Sets: (All) Aliases: Required: False @@ -257,13 +218,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity - ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector ## NOTES @@ -274,35 +231,23 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -COLLECTORPOLICIES : Collector Policies for Azure Traffic Collector. - - `[EmissionPolicyList ]`: Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. +COLLECTORPOLICY : Collector Policies for Azure Traffic Collector. + - `[Location ]`: Resource location. + - `[SystemDataCreatedAt ]`: The timestamp of resource creation (UTC). + - `[SystemDataCreatedBy ]`: The identity that created the resource. + - `[SystemDataCreatedByType ]`: The type of identity that created the resource. + - `[SystemDataLastModifiedBy ]`: The identity that last modified the resource. + - `[SystemDataLastModifiedByType ]`: The type of identity that last modified the resource. + - `[Tag ]`: Resource tags. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[EmissionPolicy ]`: Emission policies. + - `[EmissionDestination ]`: Emission policy destinations. - `[DestinationType ]`: Emission destination type. - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. + - `[IngestionPolicyIngestionSource ]`: Ingestion Sources. - `[ResourceId ]`: Resource ID. - `[SourceType ]`: Ingestion source type. - `[IngestionPolicyIngestionType ]`: The ingestion type. -INPUTOBJECT : Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - -PARAMETERS : Azure Traffic Collector resource. - - `[Location ]`: Resource location. - - `[Tags ]`: Resource tags. - - `[(Any) ]`: This indicates any property can be added to this object. - - `[CollectorPolicyList ]`: Collector Policies for Azure Traffic Collector. - - `[EmissionPolicyList ]`: Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - - `[IngestionPolicyIngestionType ]`: The ingestion type. - ## RELATED LINKS diff --git a/src/NetworkFunction/docs/Remove-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/docs/Remove-AzNetworkFunctionCollectorPolicy.md index 56159bbc0f57..d678bf59862c 100644 --- a/src/NetworkFunction/docs/Remove-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/docs/Remove-AzNetworkFunctionCollectorPolicy.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/remove-aznetworkfunctioncollectorpolicy +online version: https://docs.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctioncollectorpolicy schema: 2.0.0 --- @@ -14,15 +14,15 @@ Deletes a specified Collector Policy resource. ### Delete (Default) ``` -Remove-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName - -CollectorPolicyName -ResourceGroupName [-SubscriptionId ] [-AsJob] [-NoWait] +Remove-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] ``` ### DeleteViaIdentity ``` -Remove-AzNetworkFunctionCollectorPolicy -InputObject [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] +Remove-AzNetworkFunctionCollectorPolicy -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION @@ -32,7 +32,7 @@ Deletes a specified Collector Policy resource. ### Example 1: Delete a new traffic collector policy ```powershell -Remove-AzNetworkFunctionCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroup test +Remove-AzNetworkFunctionCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroupname test ``` ```output @@ -74,15 +74,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -CollectorPolicyName -Collector Policy Name +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: System.String -Parameter Sets: Delete -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -94,7 +94,7 @@ Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity Parameter Sets: DeleteViaIdentity Aliases: @@ -105,6 +105,21 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` +### -Name +Collector Policy Name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: CollectorPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -NoWait Run the command asynchronously @@ -201,7 +216,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity ## OUTPUTS @@ -216,9 +231,10 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - `[CollectorPolicyName ]`: Collector Policy Name + - `[Id ]`: Resource identity path - `[ResourceGroupName ]`: The name of the resource group. - `[SubscriptionId ]`: Azure Subscription ID. diff --git a/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollector.md index 0c329e098aa4..e18e61b1b8fe 100644 --- a/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/docs/Remove-AzNetworkFunctionTrafficCollector.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/remove-aznetworkfunctiontrafficcollector +online version: https://docs.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctiontrafficcollector schema: 2.0.0 --- @@ -15,13 +15,13 @@ Deletes a specified Azure Traffic Collector resource. ### Delete (Default) ``` Remove-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName [-SubscriptionId ] - [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] ``` ### DeleteViaIdentity ``` -Remove-AzNetworkFunctionTrafficCollector -InputObject [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] +Remove-AzNetworkFunctionTrafficCollector -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION @@ -31,7 +31,7 @@ Deletes a specified Azure Traffic Collector resource. ### Example 1: Delete a new traffic collector ```powershell -Remove-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup SEA-Cust10 +Remove-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname SEA-Cust10 ``` ```output @@ -41,7 +41,6 @@ Remove-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup SEA-Cust This cmdlet deletes a traffic collector. - ## PARAMETERS ### -AsJob @@ -59,12 +58,27 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -InputObject Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity Parameter Sets: DeleteViaIdentity Aliases: @@ -81,7 +95,7 @@ Azure Traffic Collector name ```yaml Type: System.String Parameter Sets: Delete -Aliases: +Aliases: AzureTrafficCollectorName Required: True Position: Named @@ -186,7 +200,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity ## OUTPUTS @@ -201,9 +215,10 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - `[CollectorPolicyName ]`: Collector Policy Name + - `[Id ]`: Resource identity path - `[ResourceGroupName ]`: The name of the resource group. - `[SubscriptionId ]`: Azure Subscription ID. diff --git a/src/NetworkFunction/docs/Update-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/docs/Update-AzNetworkFunctionCollectorPolicy.md index 65e707430d44..2f5372db11a8 100644 --- a/src/NetworkFunction/docs/Update-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/docs/Update-AzNetworkFunctionCollectorPolicy.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/set-aznetworkfunctioncollectorpolicy +online version: https://docs.microsoft.com/powershell/module/az.networkfunction/set-aznetworkfunctioncollectorpolicy schema: 2.0.0 --- @@ -12,34 +12,13 @@ Creates or updates a Collector Policy resource ## SYNTAX -### UpdateExpanded (Default) ``` -Update-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName +Update-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name -ResourceGroupName -Location [-SubscriptionId ] - [-EmissionPolicyList ] - [-IngestionPolicyIngestionSourceList ] - [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -### Update -``` -Update-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -CollectorPolicyName - -ResourceGroupName -Location -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] - [-Confirm] [-WhatIf] [] -``` - -### UpdateViaIdentity -``` -Update-AzNetworkFunctionCollectorPolicy -InputObject - -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -### UpdateViaIdentityExpanded -``` -Update-AzNetworkFunctionCollectorPolicy -InputObject - [-EmissionPolicyList ] - [-IngestionPolicyIngestionSourceList ] - [-IngestionPolicyIngestionType ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] + [-EmissionPolicy ] + [-IngestionPolicyIngestionSource ] + [-IngestionPolicyIngestionType ] [-Tag ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION @@ -49,7 +28,7 @@ Creates or updates a Collector Policy resource ### Example 1: Update a traffic collector policy ```powershell -Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname -atc -resourcegroup rg1 -location eastus +Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 -location eastus ``` ```output @@ -86,7 +65,6 @@ Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficco This cmdlet updates a traffic collector policy. - ## PARAMETERS ### -AsJob @@ -109,7 +87,7 @@ Azure Traffic Collector name ```yaml Type: System.String -Parameter Sets: Update, UpdateExpanded +Parameter Sets: (All) Aliases: Required: True @@ -119,43 +97,44 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -CollectorPolicyName -Collector Policy Name +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: System.String -Parameter Sets: Update, UpdateExpanded -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -Location -Resource location. +### -EmissionPolicy +Emission policies. +To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. ```yaml -Type: System.String -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IEmissionPoliciesPropertiesFormat[] +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -EmissionPolicyList -Emission policies. -To construct, see NOTES section for EMISSIONPOLICIES properties and create a hash table. +### -IngestionPolicyIngestionSource +Ingestion Sources. +To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IEmissionPoliciesPropertiesFormat[] -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IIngestionSourcesPropertiesFormat[] +Parameter Sets: (All) Aliases: Required: False @@ -165,13 +144,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IngestionPolicyIngestionSourceList -Ingestion Sources. -To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCES properties and create a hash table. +### -IngestionPolicyIngestionType +The ingestion type. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IIngestionSourcesPropertiesFormat[] -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType +Parameter Sets: (All) Aliases: Required: False @@ -181,34 +159,33 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IngestionPolicyIngestionType -The ingestion type. +### -Location +Resource location. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Type: System.String +Parameter Sets: (All) Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. +### -Name +Collector Policy Name ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity -Parameter Sets: UpdateViaIdentity, UpdateViaIdentityExpanded -Aliases: +Type: System.String +Parameter Sets: (All) +Aliases: CollectorPolicyName Required: True Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -227,48 +204,47 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Parameters -Collection policy resource. -To construct, see NOTES section for PARAMETERS properties and create a hash table. +### -ResourceGroupName +The name of the resource group. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy -Parameter Sets: Update, UpdateViaIdentity +Type: System.String +Parameter Sets: (All) Aliases: Required: True Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceGroupName -The name of the resource group. +### -SubscriptionId +Azure Subscription ID. ```yaml Type: System.String -Parameter Sets: Update, UpdateExpanded +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named -Default value: None +Default value: (Get-AzContext).Subscription.Id Accept pipeline input: False Accept wildcard characters: False ``` -### -SubscriptionId -Azure Subscription ID. +### -Tag +Resource tags. ```yaml -Type: System.String -Parameter Sets: Update, UpdateExpanded +Type: System.Collections.Hashtable +Parameter Sets: (All) Aliases: Required: False Position: Named -Default value: (Get-AzContext).Subscription.Id +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -309,13 +285,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity - ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy ## NOTES @@ -326,29 +298,14 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -EMISSIONPOLICIES : Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. +EMISSIONPOLICY : Emission policies. + - `[EmissionDestination ]`: Emission policy destinations. - `[DestinationType ]`: Emission destination type. - `[EmissionType ]`: Emission format type. -INGESTIONPOLICYINGESTIONSOURCES : Ingestion Sources. +INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. - `[ResourceId ]`: Resource ID. - `[SourceType ]`: Ingestion source type. -INPUTOBJECT : Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - -PARAMETERS : Collection policy resource. - - `[EmissionPolicyList ]`: Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - - `[IngestionPolicyIngestionType ]`: The ingestion type. - ## RELATED LINKS + diff --git a/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollector.md index 9bd0d9fb7f3f..525e4ff14d65 100644 --- a/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollector.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/set-aznetworkfunctiontrafficcollector +online version: https://docs.microsoft.com/powershell/module/az.networkfunction/set-aznetworkfunctiontrafficcollector schema: 2.0.0 --- @@ -12,31 +12,10 @@ Creates or updates a Azure Traffic Collector resource ## SYNTAX -### UpdateExpanded (Default) ``` Update-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location - [-SubscriptionId ] [-CollectorPolicyList ] [-Tags ] [-AsJob] [-NoWait] - [-Confirm] [-WhatIf] [] -``` - -### Update -``` -Update-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location - -Parameters [-SubscriptionId ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] - [] -``` - -### UpdateViaIdentity -``` -Update-AzNetworkFunctionTrafficCollector -InputObject - -Parameters [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] -``` - -### UpdateViaIdentityExpanded -``` -Update-AzNetworkFunctionTrafficCollector -InputObject -Location - [-CollectorPolicyList ] [-Tags ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] - [] + [-SubscriptionId ] [-CollectorPolicy ] [-Tag ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION @@ -46,7 +25,7 @@ Creates or updates a Azure Traffic Collector resource ### Example 1: Updates a traffic collector ```powershell -Update-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroup test -location eastus +Update-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname test -location eastus ``` ```output @@ -82,13 +61,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -CollectorPolicyList +### -CollectorPolicy Collector Policies for Azure Traffic Collector. -To construct, see NOTES section for COLLECTORPOLICIES properties and create a hash table. +To construct, see NOTES section for COLLECTORPOLICY properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ICollectorPolicy[] -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy[] +Parameter Sets: (All) Aliases: Required: False @@ -98,19 +77,18 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity -Parameter Sets: UpdateViaIdentity, UpdateViaIdentityExpanded -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -119,7 +97,7 @@ Resource location. ```yaml Type: System.String -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Parameter Sets: (All) Aliases: Required: True @@ -134,8 +112,8 @@ Azure Traffic Collector name ```yaml Type: System.String -Parameter Sets: Update, UpdateExpanded -Aliases: +Parameter Sets: (All) +Aliases: AzureTrafficCollectorName Required: True Position: Named @@ -159,28 +137,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Parameters -Azure Traffic Collector resource. -To construct, see NOTES section for PARAMETERS properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector -Parameter Sets: Update, UpdateViaIdentity -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -ResourceGroupName The name of the resource group. ```yaml Type: System.String -Parameter Sets: Update, UpdateExpanded +Parameter Sets: (All) Aliases: Required: True @@ -195,7 +157,7 @@ Azure Subscription ID. ```yaml Type: System.String -Parameter Sets: Update, UpdateExpanded +Parameter Sets: (All) Aliases: Required: False @@ -205,12 +167,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Tags +### -Tag Resource tags. ```yaml Type: System.Collections.Hashtable -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Parameter Sets: (All) Aliases: Required: False @@ -256,13 +218,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity - ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector ## NOTES @@ -273,34 +231,23 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -COLLECTORPOLICIES : Collector Policies for Azure Traffic Collector. - - `[EmissionPolicyList ]`: Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. +COLLECTORPOLICY : Collector Policies for Azure Traffic Collector. + - `[Location ]`: Resource location. + - `[SystemDataCreatedAt ]`: The timestamp of resource creation (UTC). + - `[SystemDataCreatedBy ]`: The identity that created the resource. + - `[SystemDataCreatedByType ]`: The type of identity that created the resource. + - `[SystemDataLastModifiedBy ]`: The identity that last modified the resource. + - `[SystemDataLastModifiedByType ]`: The type of identity that last modified the resource. + - `[Tag ]`: Resource tags. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[EmissionPolicy ]`: Emission policies. + - `[EmissionDestination ]`: Emission policy destinations. - `[DestinationType ]`: Emission destination type. - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. + - `[IngestionPolicyIngestionSource ]`: Ingestion Sources. - `[ResourceId ]`: Resource ID. - `[SourceType ]`: Ingestion source type. - `[IngestionPolicyIngestionType ]`: The ingestion type. -INPUTOBJECT : Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - -PARAMETERS : Azure Traffic Collector resource. - - `[Location ]`: Resource location. - - `[Tags ]`: Resource tags. - - `[(Any) ]`: This indicates any property can be added to this object. - - `[CollectorPolicyList ]`: Collector Policies for Azure Traffic Collector. - - `[EmissionPolicyList ]`: Emission policies. - - `[EmissionDestinations ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSourceList ]`: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - - `[IngestionPolicyIngestionType ]`: The ingestion type. - ## RELATED LINKS + diff --git a/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollectorTag.md b/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollectorTag.md index 44e82855d98f..4f755dbf8c22 100644 --- a/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollectorTag.md +++ b/src/NetworkFunction/docs/Update-AzNetworkFunctionTrafficCollectorTag.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.NetworkFunction -online version: https://docs.microsoft.com/en-us/powershell/module/az.networkfunction/update-aznetworkfunctiontrafficcollectortag +online version: https://docs.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctiontrafficcollectortag schema: 2.0.0 --- @@ -15,25 +15,14 @@ Updates the specified Azure Traffic Collector tags. ### UpdateExpanded (Default) ``` Update-AzNetworkFunctionTrafficCollectorTag -AzureTrafficCollectorName -ResourceGroupName - [-SubscriptionId ] [-Tags ] [-Confirm] [-WhatIf] [] -``` - -### Update -``` -Update-AzNetworkFunctionTrafficCollectorTag -AzureTrafficCollectorName -ResourceGroupName - -Parameters [-SubscriptionId ] [-Confirm] [-WhatIf] [] -``` - -### UpdateViaIdentity -``` -Update-AzNetworkFunctionTrafficCollectorTag -InputObject -Parameters - [-Confirm] [-WhatIf] [] + [-SubscriptionId ] [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] ``` ### UpdateViaIdentityExpanded ``` -Update-AzNetworkFunctionTrafficCollectorTag -InputObject [-Tags ] - [-Confirm] [-WhatIf] [] +Update-AzNetworkFunctionTrafficCollectorTag -InputObject [-Tag ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION @@ -43,7 +32,7 @@ Updates the specified Azure Traffic Collector tags. ### Example 1: Updates a traffic collector tag ```powershell -Update-AzNetworkFunctionTrafficCollectorTag -azuretrafficcollectorname atc -resourcegroup rg1 +Update-AzNetworkFunctionTrafficCollectorTag -azuretrafficcollectorname atc -resourcegroupname rg1 ``` ```output @@ -73,7 +62,7 @@ Azure Traffic Collector name ```yaml Type: System.String -Parameter Sets: Update, UpdateExpanded +Parameter Sets: UpdateExpanded Aliases: Required: True @@ -83,29 +72,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity -Parameter Sets: UpdateViaIdentity, UpdateViaIdentityExpanded -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -Parameters -Tags object for patch operations. -To construct, see NOTES section for PARAMETERS properties and create a hash table. +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITagsObject -Parameter Sets: Update, UpdateViaIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity +Parameter Sets: UpdateViaIdentityExpanded Aliases: Required: True @@ -120,7 +108,7 @@ The name of the resource group. ```yaml Type: System.String -Parameter Sets: Update, UpdateExpanded +Parameter Sets: UpdateExpanded Aliases: Required: True @@ -135,7 +123,7 @@ Azure Subscription ID. ```yaml Type: System.String -Parameter Sets: Update, UpdateExpanded +Parameter Sets: UpdateExpanded Aliases: Required: False @@ -145,12 +133,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Tags +### -Tag Resource tags. ```yaml Type: System.Collections.Hashtable -Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Parameter Sets: (All) Aliases: Required: False @@ -196,13 +184,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITagsObject - -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.ITrafficCollectorIdentity +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20210501.IAzureTrafficCollector +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IAzureTrafficCollector ## NOTES @@ -213,15 +199,12 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - `[CollectorPolicyName ]`: Collector Policy Name + - `[Id ]`: Resource identity path - `[ResourceGroupName ]`: The name of the resource group. - `[SubscriptionId ]`: Azure Subscription ID. -PARAMETERS : Tags object for patch operations. - - `[Tags ]`: Resource tags. - - `[(Any) ]`: This indicates any property can be added to this object. - ## RELATED LINKS