Skip to content

Commit d8c8362

Browse files
committed
Revert "Remove NetworkSecurityPerimeter from generation branch (#22482)"
This reverts commit 851c53a.
1 parent 0939e23 commit d8c8362

File tree

104 files changed

+13809
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+13809
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
10+
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@{
2+
GUID = '9560a0c7-e4ed-40d0-a8c4-9b28b241edca'
3+
RootModule = './Az.NetworkSecurityPerimeter.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: NetworkSecurityPerimeter cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.NetworkSecurityPerimeter.private.dll'
13+
FormatsToProcess = './Az.NetworkSecurityPerimeter.format.ps1xml'
14+
FunctionsToExport = 'Get-AzNetworkSecurityPerimeter', 'Get-AzNetworkSecurityPerimeterAccessRule', 'Get-AzNetworkSecurityPerimeterAssociableResourceType', 'Get-AzNetworkSecurityPerimeterAssociation', 'Get-AzNetworkSecurityPerimeterLink', 'Get-AzNetworkSecurityPerimeterLinkReference', 'Get-AzNetworkSecurityPerimeterProfile', 'New-AzNetworkSecurityPerimeter', 'New-AzNetworkSecurityPerimeterAccessRule', 'New-AzNetworkSecurityPerimeterAssociation', 'New-AzNetworkSecurityPerimeterLink', 'New-AzNetworkSecurityPerimeterProfile', 'Remove-AzNetworkSecurityPerimeter', 'Remove-AzNetworkSecurityPerimeterAccessRule', 'Remove-AzNetworkSecurityPerimeterAssociation', 'Remove-AzNetworkSecurityPerimeterLink', 'Remove-AzNetworkSecurityPerimeterLinkReference', 'Remove-AzNetworkSecurityPerimeterProfile', 'Update-AzNetworkSecurityPerimeterAccessRule', 'Update-AzNetworkSecurityPerimeterAssociation', 'Update-AzNetworkSecurityPerimeterLink', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
17+
PSData = @{
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'NetworkSecurityPerimeter'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
24+
}
Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
<!-- region Generated -->
2+
# Az.NetworkSecurityPerimeter
3+
This directory contains the PowerShell module for the NetworkSecurityPerimeter service.
4+
5+
---
6+
## Status
7+
[![Az.NetworkSecurityPerimeter](https://img.shields.io/powershellgallery/v/Az.NetworkSecurityPerimeter.svg?style=flat-square&label=Az.NetworkSecurityPerimeter "Az.NetworkSecurityPerimeter")](https://www.powershellgallery.com/packages/Az.NetworkSecurityPerimeter/)
8+
9+
## Info
10+
- Modifiable: yes
11+
- Generated: all
12+
- Committed: yes
13+
- Packaged: yes
14+
15+
---
16+
## Detail
17+
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
18+
19+
## Module Requirements
20+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 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+
25+
## Development
26+
For information on how to develop for `Az.NetworkSecurityPerimeter`, see [how-to.md](how-to.md).
27+
<!-- endregion -->
28+
29+
### AutoRest Configuration
30+
> see https://aka.ms/autorest
31+
32+
``` yaml
33+
require:
34+
# readme.azure.noprofile.md is the common configuration file
35+
# - ../../../../tools/SwaggerCI/readme.azure.noprofile.md
36+
- $(this-folder)/../../readme.azure.noprofile.md
37+
input-file:
38+
# You need to specify your swagger files here.
39+
- https://github.com/kaushal087/azure-rest-api-specs/blob/01701c5f89029cedfb89e9e34a43fdedfeb8ab25/specification/network/resource-manager/Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json
40+
# - C:\repo\azure-rest-api-specs/specification/network/resource-manager/Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json
41+
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
42+
# - (this-folder)/relative-path-to-your-swagger
43+
44+
# For new RP, the version is 0.1.0
45+
module-version: 0.1.0
46+
# Normally, title is the service name
47+
root-module-name: $(prefix).Network
48+
title: NetworkSecurityPerimeter
49+
subject-prefix: $(service-name)
50+
sanitize-names: true
51+
52+
# If there are post APIs for some kinds of actions in the RP, you may need to
53+
# uncomment following line to support viaIdentity for these post APIs
54+
# identity-correction-for-post: true
55+
56+
directive:
57+
# Following is two common directive which are normally required in all the RPs
58+
# 1. Remove the unexpanded parameter set
59+
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
60+
# - where:
61+
# variant: ^Create$|^CreateViaIdentityExpanded$
62+
# remove: true
63+
# Remove the set-* cmdlet
64+
- where:
65+
verb: Set
66+
remove: true
67+
- where:
68+
variant: ^Update$|^UpdateViaIdentity$|^UpdateViaIdentityExpanded$
69+
remove: true
70+
# Hide CreateViaIdentity for customization
71+
- where:
72+
variant: ^CreateViaIdentity$
73+
hide: true
74+
- where:
75+
subject: NetworkSecurityPerimeter
76+
set:
77+
subject-prefix: ''
78+
- where:
79+
subject: NspProfile
80+
set:
81+
subject: Profile
82+
- where:
83+
subject: NspAccessRule
84+
set:
85+
subject: AccessRule
86+
- where:
87+
subject: NspAssociation
88+
set:
89+
subject: Association
90+
- where:
91+
subject: NspLink
92+
set:
93+
subject: Link
94+
- where:
95+
subject: NspLinkReference
96+
set:
97+
subject: LinkReference
98+
99+
# Parameter Update
100+
# NSP
101+
- where:
102+
subject: NetworkSecurityPerimeter
103+
parameter-name: Name
104+
set:
105+
alias:
106+
- SecurityPerimeterName
107+
- NSPName
108+
109+
- where:
110+
subject: NetworkSecurityPerimeter
111+
parameter-name: Id
112+
set:
113+
parameter-name: SecurityPerimeterId
114+
alias:
115+
- Id
116+
117+
# Profile
118+
- where:
119+
subject: Profile
120+
parameter-name: ProfileName
121+
set:
122+
parameter-name: Name
123+
alias:
124+
- ProfileName
125+
126+
- where:
127+
subject: Profile
128+
parameter-name: Id
129+
set:
130+
parameter-name: ProfileId
131+
alias:
132+
- Id
133+
134+
- where:
135+
subject: Profile
136+
parameter-name: NetworkSecurityPerimeterName
137+
set:
138+
parameter-name: SecurityPerimeterName
139+
alias:
140+
- NetworkSecurityPerimeterName
141+
- NSPName
142+
143+
# AccessRule
144+
- where:
145+
subject: AccessRule
146+
parameter-name: NetworkSecurityPerimeterName
147+
set:
148+
parameter-name: SecurityPerimeterName
149+
alias:
150+
- NetworkSecurityPerimeterName
151+
- NSPName
152+
153+
- where:
154+
subject: AccessRule
155+
parameter-name: Id
156+
set:
157+
parameter-name: AccessRuleId
158+
alias:
159+
- Id
160+
161+
- where:
162+
subject: AccessRule
163+
parameter-name: ProfileName
164+
set:
165+
parameter-name: ProfileName
166+
alias:
167+
- SecurityPerimeterProfileName
168+
- NSPProfileName
169+
170+
- where:
171+
subject: AccessRule
172+
parameter-name: AccessRuleName
173+
set:
174+
parameter-name: Name
175+
alias:
176+
- AccessRuleName
177+
178+
- where:
179+
subject: AccessRule
180+
parameter-name: NetworkSecurityPerimeter
181+
set:
182+
parameter-name: Perimeter
183+
184+
# Association
185+
- where:
186+
subject: Association
187+
parameter-name: NetworkSecurityPerimeterName
188+
set:
189+
parameter-name: SecurityPerimeterName
190+
alias:
191+
- NetworkSecurityPerimeterName
192+
- NSPName
193+
194+
- where:
195+
subject: Association
196+
parameter-name: ProfileName
197+
set:
198+
parameter-name: ProfileName
199+
alias:
200+
- SecurityPerimeterProfileName
201+
- NSPProfileName
202+
203+
- where:
204+
subject: Association
205+
parameter-name: AssociationName
206+
set:
207+
parameter-name: Name
208+
alias:
209+
- AssociationName
210+
211+
- where:
212+
subject: Association
213+
parameter-name: Id
214+
set:
215+
parameter-name: AssociationId
216+
alias:
217+
- Id
218+
219+
# Link
220+
- where:
221+
subject: Link
222+
parameter-name: LinkName
223+
set:
224+
parameter-name: Name
225+
alias:
226+
- LinkName
227+
228+
- where:
229+
subject: Link
230+
parameter-name: Id
231+
set:
232+
parameter-name: LinkId
233+
alias:
234+
- Id
235+
236+
- where:
237+
subject: Link
238+
parameter-name: NetworkSecurityPerimeterName
239+
set:
240+
parameter-name: SecurityPerimeterName
241+
alias:
242+
- NetworkSecurityPerimeterName
243+
- NSPName
244+
245+
# LinkReference
246+
- where:
247+
subject: LinkReference
248+
parameter-name: LinkReferenceName
249+
set:
250+
parameter-name: Name
251+
alias:
252+
- LinkReferenceName
253+
254+
- where:
255+
subject: LinkReference
256+
parameter-name: Id
257+
set:
258+
parameter-name: LinkReferenceId
259+
alias:
260+
- Id
261+
262+
- where:
263+
subject: LinkReference
264+
parameter-name: NetworkSecurityPerimeterName
265+
set:
266+
parameter-name: SecurityPerimeterName
267+
alias:
268+
- NetworkSecurityPerimeterName
269+
- NSPName
270+
271+
# feature request for the below change https://github.com/Azure/autorest.powershell/issues/982
272+
- from: source-file-csharp
273+
where: $
274+
transform: $ = $.replace('if (result.NextLink != null)', 'if (result.NextLink != null && result.NextLink != "")')
275+
276+
- from: source-file-csharp
277+
where: $
278+
transform: $ = $.replace('_nextLink != null', '_nextLink != null && _nextLink != ""')
279+
280+
```
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Custom
2+
This directory contains custom implementation for non-generated cmdlets for the `Az.NetworkSecurityPerimeter` 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.NetworkSecurityPerimeter.custom.psm1`. This file should not be modified.
3+
4+
## Info
5+
- Modifiable: yes
6+
- Generated: partial
7+
- Committed: yes
8+
- Packaged: yes
9+
10+
## Details
11+
For `Az.NetworkSecurityPerimeter` 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*.
12+
13+
For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.NetworkSecurityPerimeter.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.
14+
15+
For script cmdlets, these are loaded via the `Az.NetworkSecurityPerimeter.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.
16+
17+
## Purpose
18+
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.
19+
20+
## Usage
21+
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:
22+
- Break
23+
- DefaultProfile
24+
- HttpPipelineAppend
25+
- HttpPipelinePrepend
26+
- Proxy
27+
- ProxyCredential
28+
- ProxyUseDefaultCredentials
29+
30+
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.NetworkSecurityPerimeter`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
31+
32+
### Attributes
33+
For processing the cmdlets, we've created some additional attributes:
34+
- `Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.DescriptionAttribute`
35+
- 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.
36+
- `Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.DoNotExportAttribute`
37+
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.NetworkSecurityPerimeter`.
38+
- `Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.InternalExportAttribute`
39+
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.NetworkSecurityPerimeter`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
40+
- `Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.ProfileAttribute`
41+
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.

0 commit comments

Comments
 (0)