Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Az.network function1 #18966

Merged
merged 28 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4dfbe27
updated readme
kukulkarni1 Jul 15, 2022
db5b027
Added custom script for get traffic collector
kukulkarni1 Jul 18, 2022
bb8f081
readme indentation
kukulkarni1 Jul 18, 2022
d0f68f8
resolving compile issues
kukulkarni1 Jul 18, 2022
f0ebf4d
resolving compile issues
kukulkarni1 Jul 18, 2022
31f160c
removed extra file
kukulkarni1 Jul 18, 2022
ba7e6fa
renamed file
kukulkarni1 Jul 19, 2022
82e1aa6
added new collector policy cmdlet
kukulkarni1 Jul 19, 2022
e497394
solving compile issues
kukulkarni1 Jul 19, 2022
6253baa
solving compile issues
kukulkarni1 Jul 19, 2022
e424ea6
solving compile issues
kukulkarni1 Jul 19, 2022
ce56968
added new ps script
kukulkarni1 Jul 19, 2022
3cd1cf9
added new ps script
kukulkarni1 Jul 19, 2022
8302601
New cmdlet csharp script
kukulkarni1 Jul 20, 2022
d1efa74
New cmdlet csharp bug fix
kukulkarni1 Jul 20, 2022
be35ed5
change operationId in readme
kukulkarni1 Jul 21, 2022
39e45d2
Changed functions to export
kukulkarni1 Jul 21, 2022
6c2a104
removing new cmdlet
kukulkarni1 Jul 21, 2022
eccb83b
Updated swagger commit id
kukulkarni1 Jul 29, 2022
cf1fd66
added customization for location property
kukulkarni1 Aug 3, 2022
1b5568d
Adding all files after running buildmodule
kukulkarni1 Aug 3, 2022
8a0489a
updated docs and examples
kukulkarni1 Aug 3, 2022
f212db6
minor typo
kukulkarni1 Aug 3, 2022
09c0c8c
removed set cmdlet, simplified custom cmdlets
kukulkarni1 Aug 4, 2022
5f5a30d
removed set cmdlet
kukulkarni1 Aug 4, 2022
13c6c8e
Added update cmdlet
kukulkarni1 Aug 5, 2022
b4a799b
updated examples
kukulkarni1 Aug 12, 2022
dae6e1c
updating docs folder
kukulkarni1 Aug 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/NetworkFunction/.gitignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/NetworkFunction/Az.NetworkFunction.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -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-AzNetworkFunctionCollectorPolicy', 'Get-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Update-AzNetworkFunctionTrafficCollectorTag', '*'
AliasesToExport = '*'
PrivateData = @{
PSData = @{
Expand Down
24 changes: 20 additions & 4 deletions src/NetworkFunction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
<!-- endregion -->
Expand All @@ -24,11 +30,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)
Expand All @@ -37,10 +43,20 @@ 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
- from: swagger-document
where: $.paths..operationId
transform: return $.replace(/^(AzureTrafficCollectors)(.+)(_List)$/, "$1$3$2")
- where:
subject: (.)*(Operation)$
hide: true
kukulkarni1 marked this conversation as resolved.
Show resolved Hide resolved
- where:
verb: Set
verb: New|Set
hide: true
```
```
178 changes: 178 additions & 0 deletions src/NetworkFunction/custom/New-AzNetworkFunctionCollectorPolicy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@

# ----------------------------------------------------------------------------------
# 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 <IEmissionPoliciesPropertiesFormat[]>: Emission policies.
[EmissionDestination <IEmissionPolicyDestination[]>]: Emission policy destinations.
[DestinationType <DestinationType?>]: Emission destination type.
[EmissionType <EmissionType?>]: Emission format type.

INGESTIONPOLICYINGESTIONSOURCE <IIngestionSourcesPropertiesFormat[]>: Ingestion Sources.
[ResourceId <String>]: Resource ID.
[SourceType <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}
)

process {
try {
kukulkarni1 marked this conversation as resolved.
Show resolved Hide resolved
Az.NetworkFunction.internal\New-AzNetworkFunctionCollectorPolicy @PSBoundParameters
} catch {
throw
}
}
}
Loading