Skip to content

Commit 9a98bd5

Browse files
authored
[NetworkFunctions] bug fix and rename (#18966)
* updated readme * Added custom script for get traffic collector * readme indentation * resolving compile issues * resolving compile issues * removed extra file * renamed file * added new collector policy cmdlet * solving compile issues * solving compile issues * solving compile issues * added new ps script * added new ps script * New cmdlet csharp script * New cmdlet csharp bug fix * change operationId in readme * Changed functions to export * removing new cmdlet * Updated swagger commit id * added customization for location property * Adding all files after running buildmodule * updated docs and examples * minor typo * removed set cmdlet, simplified custom cmdlets * removed set cmdlet * Added update cmdlet * updated examples * updating docs folder
1 parent 29069a4 commit 9a98bd5

File tree

39 files changed

+2028
-1338
lines changed

39 files changed

+2028
-1338
lines changed

src/NetworkFunction/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
bin
22
obj
33
.vs
4+
generated
5+
internal
6+
exports
47
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
510
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec

src/NetworkFunction/Az.NetworkFunction.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.NetworkFunction.private.dll'
1313
FormatsToProcess = './Az.NetworkFunction.format.ps1xml'
14-
FunctionsToExport = 'Get-AzNetworkFunctionOperation', 'Get-AzNetworkFunctionTrafficCollector', 'Get-AzNetworkFunctionTrafficCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionTrafficCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionTrafficCollectorPolicy', 'Set-AzNetworkFunctionTrafficCollector', 'Set-AzNetworkFunctionTrafficCollectorPolicy', 'Update-AzNetworkFunctionTrafficCollectorTag', '*'
14+
FunctionsToExport = 'Get-AzNetworkFunctionCollectorPolicy', 'Get-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Update-AzNetworkFunctionTrafficCollectorTag', '*'
1515
AliasesToExport = '*'
1616
PrivateData = @{
1717
PSData = @{

src/NetworkFunction/README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ This directory contains the PowerShell module for the Az.NetworkFunction service
1616
## Detail
1717
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
1818

19+
## Module Requirements
20+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater
21+
22+
## Authentication
23+
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
24+
1925
## Development
2026
For information on how to develop for `Az.NetworkFunction`, see [how-to.md](how-to.md).
2127
<!-- endregion -->
@@ -24,11 +30,11 @@ For information on how to develop for `Az.NetworkFunction`, see [how-to.md](how-
2430
> see https://aka.ms/autorest
2531
2632
``` yaml
27-
branch: 2f47130d8fb333f55596ca9d149fbdceaff6f4be
33+
branch: 1cefdabe75c75323c6d3def3f6c80850c624bdea
2834
require:
2935
- $(this-folder)/../readme.azure.noprofile.md
3036
input-file:
31-
- $(repo)/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/AzureTrafficCollector.json
37+
- $(repo)/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-08-01/AzureTrafficCollector.json
3238
module-version: 0.1.0
3339
title: NetworkFunction
3440
subject-prefix: $(service-name)
@@ -37,10 +43,20 @@ resourcegroup-append: true
3743
nested-object-to-string: true
3844

3945
directive:
46+
- where:
47+
subject: ^AzureTrafficCollector(.*)
48+
set:
49+
subject: TrafficCollector$1
4050
- where:
4151
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
4252
hide: true
53+
- from: swagger-document
54+
where: $.paths..operationId
55+
transform: return $.replace(/^(AzureTrafficCollectors)(.+)(_List)$/, "$1$3$2")
56+
- where:
57+
subject: (.)*(Operation)$
58+
hide: true
4359
- where:
44-
verb: Set
60+
verb: New|Set
4561
hide: true
46-
```
62+
```
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
14+
# is regenerated.
15+
# ----------------------------------------------------------------------------------
16+
17+
<#
18+
.Synopsis
19+
Creates or updates a Collector Policy resource
20+
.Description
21+
Creates or updates a Collector Policy resource
22+
.Example
23+
{{ Add code here }}
24+
.Example
25+
{{ Add code here }}
26+
27+
.Outputs
28+
Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy
29+
.Notes
30+
COMPLEX PARAMETER PROPERTIES
31+
32+
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.
33+
34+
EMISSIONPOLICY <IEmissionPoliciesPropertiesFormat[]>: Emission policies.
35+
[EmissionDestination <IEmissionPolicyDestination[]>]: Emission policy destinations.
36+
[DestinationType <DestinationType?>]: Emission destination type.
37+
[EmissionType <EmissionType?>]: Emission format type.
38+
39+
INGESTIONPOLICYINGESTIONSOURCE <IIngestionSourcesPropertiesFormat[]>: Ingestion Sources.
40+
[ResourceId <String>]: Resource ID.
41+
[SourceType <SourceType?>]: Ingestion source type.
42+
.Link
43+
https://docs.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy
44+
#>
45+
function New-AzNetworkFunctionCollectorPolicy {
46+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ICollectorPolicy])]
47+
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
48+
param(
49+
[Parameter(Mandatory)]
50+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')]
51+
[System.String]
52+
# Azure Traffic Collector name
53+
${AzureTrafficCollectorName},
54+
55+
[Parameter(Mandatory)]
56+
[Alias('CollectorPolicyName')]
57+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')]
58+
[System.String]
59+
# Collector Policy Name
60+
${Name},
61+
62+
[Parameter(Mandatory)]
63+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')]
64+
[System.String]
65+
# The name of the resource group.
66+
${ResourceGroupName},
67+
68+
[Parameter()]
69+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')]
70+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
71+
[System.String]
72+
# Azure Subscription ID.
73+
${SubscriptionId},
74+
75+
[Parameter()]
76+
[AllowEmptyCollection()]
77+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')]
78+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IEmissionPoliciesPropertiesFormat[]]
79+
# Emission policies.
80+
# To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table.
81+
${EmissionPolicy},
82+
83+
[Parameter()]
84+
[AllowEmptyCollection()]
85+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')]
86+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.IIngestionSourcesPropertiesFormat[]]
87+
# Ingestion Sources.
88+
# To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table.
89+
${IngestionPolicyIngestionSource},
90+
91+
[Parameter()]
92+
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])]
93+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')]
94+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType]
95+
# The ingestion type.
96+
${IngestionPolicyIngestionType},
97+
98+
[Parameter(Mandatory)]
99+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')]
100+
[System.String]
101+
# Resource location.
102+
${Location},
103+
104+
[Parameter()]
105+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')]
106+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20220801.ITrackedResourceTags]))]
107+
[System.Collections.Hashtable]
108+
# Resource tags.
109+
${Tag},
110+
111+
[Parameter()]
112+
[Alias('AzureRMContext', 'AzureCredential')]
113+
[ValidateNotNull()]
114+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')]
115+
[System.Management.Automation.PSObject]
116+
# The credentials, account, tenant, and subscription used for communication with Azure.
117+
${DefaultProfile},
118+
119+
[Parameter()]
120+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')]
121+
[System.Management.Automation.SwitchParameter]
122+
# Run the command as a job
123+
${AsJob},
124+
125+
[Parameter(DontShow)]
126+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')]
127+
[System.Management.Automation.SwitchParameter]
128+
# Wait for .NET debugger to attach
129+
${Break},
130+
131+
[Parameter(DontShow)]
132+
[ValidateNotNull()]
133+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')]
134+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]]
135+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
136+
${HttpPipelineAppend},
137+
138+
[Parameter(DontShow)]
139+
[ValidateNotNull()]
140+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')]
141+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]]
142+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
143+
${HttpPipelinePrepend},
144+
145+
[Parameter()]
146+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')]
147+
[System.Management.Automation.SwitchParameter]
148+
# Run the command asynchronously
149+
${NoWait},
150+
151+
[Parameter(DontShow)]
152+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')]
153+
[System.Uri]
154+
# The URI for the proxy server to use
155+
${Proxy},
156+
157+
[Parameter(DontShow)]
158+
[ValidateNotNull()]
159+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')]
160+
[System.Management.Automation.PSCredential]
161+
# Credentials for a proxy server to use for the remote call
162+
${ProxyCredential},
163+
164+
[Parameter(DontShow)]
165+
[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')]
166+
[System.Management.Automation.SwitchParameter]
167+
# Use the default credentials for the proxy
168+
${ProxyUseDefaultCredentials}
169+
)
170+
171+
process {
172+
try {
173+
Az.NetworkFunction.internal\New-AzNetworkFunctionCollectorPolicy @PSBoundParameters
174+
} catch {
175+
throw
176+
}
177+
}
178+
}

0 commit comments

Comments
 (0)