Skip to content

Commit a0fb995

Browse files
iancaragolTheOnlyWei
authored andcommitted
[2301] update Azs.Network.Admin to 1.1.0
1 parent 4b75640 commit a0fb995

40 files changed

+3044
-1378
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ obj
44
generated
55
internal
66
exports
7+
src/**/utils
78
src/**/tools
89
src/**/resources
910
.gitignore
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 `Azs.Network.Admin` 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 `Azs.Network.Admin.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 `Azs.Network.Admin` 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/Azs.Network.Admin.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 `Azs.Network.Admin.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 `Azs.Network.Admin`. 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.NetworkAdmin.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.NetworkAdmin.DoNotExportAttribute`
37+
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Azs.Network.Admin`.
38+
- `Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.InternalExportAttribute`
39+
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Azs.Network.Admin`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
40+
- `Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.ProfileAttribute`
41+
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.

src/Azs.Network.Admin/docs/latest/Azs.Network.Admin.md renamed to src/Azs.Network.Admin/docs/Azs.Network.Admin.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
Module Name: Azs.Network.Admin
3-
Module Guid: 818c880d-2aa0-4aa3-961c-cc58c4ef12b2
3+
Module Guid: 70926bce-bc6d-44d9-9c7c-04173e27f5c9
44
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azs.network.admin
55
Help Version: 1.0.0.0
66
Locale: en-US
77
---
88

99
# Azs.Network.Admin Module
1010
## Description
11-
Preview release of the Network operators module which allows operators to monitor network resources and manage network quotas.
11+
Microsoft AzureStack PowerShell: Network Admin cmdlets
1212

1313
## Azs.Network.Admin Cmdlets
1414
### [Get-AzsLoadBalancer](Get-AzsLoadBalancer.md)
@@ -26,6 +26,9 @@ List of public IP addresses.
2626
### [Get-AzsVirtualNetwork](Get-AzsVirtualNetwork.md)
2727
Get a list of all virtual networks.
2828

29+
### [Get-AzsVirtualNetworkGatewayConnection](Get-AzsVirtualNetworkGatewayConnection.md)
30+
Returns a list of all Virtual Network Gateway Connections.
31+
2932
### [New-AzsNetworkQuota](New-AzsNetworkQuota.md)
3033
Create or update a quota.
3134

src/Azs.Network.Admin/docs/latest/Get-AzsLoadBalancer.md renamed to src/Azs.Network.Admin/docs/Get-AzsLoadBalancer.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,34 @@ Get a list of all load balancers.
2222

2323
## EXAMPLES
2424

25-
### -------------------------- EXAMPLE 1 --------------------------
25+
### Example 1: Default Get
2626
```powershell
27-
Get-AzsLoadBalancer
28-
To view examples, please use the -Online parameter with Get-Help or navigate to: https://docs.microsoft.com/en-us/powershell/module/azs.network.admin/get-azsloadbalancer
27+
PS C:\> Get-AzsLoadBalancer
28+
29+
Id : /subscriptions/3ff3b1de-e7f5-43ad-b057-ace4767e7d01/resourceGroups/AppServiceLH01/providers/Microsoft.Network/loadBalancers/aps-sql-lb
30+
Location :
31+
Name : aps-sql-lb
32+
ProvisioningState : Succeeded
33+
PublicIPAddress : {}
34+
SubscriptionId : 3ff3b1de-e7f5-43ad-b057-ace4767e7d01
35+
Tag : Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.Api20150615.ResourceTags
36+
TenantResourceUri : /subscriptions/3ff3b1de-e7f5-43ad-b057-ace4767e7d01/resourceGroups/AppServiceLH01/providers/Microsoft.Network/loadBalancers/aps-sql-lb
37+
Type : Microsoft.Network.Admin/adminLoadBalancers
38+
39+
Id : /subscriptions/3ff3b1de-e7f5-43ad-b057-ace4767e7d01/resourceGroups/AppServiceLH01/providers/Microsoft.Network/loadBalancers/FrontEndServersLoadBalanc
40+
er
41+
Location :
42+
Name : FrontEndServersLoadBalancer
43+
ProvisioningState : Succeeded
44+
PublicIPAddress : {100.81.128.40}
45+
SubscriptionId : 3ff3b1de-e7f5-43ad-b057-ace4767e7d01
46+
Tag : Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.Api20150615.ResourceTags
47+
TenantResourceUri : /subscriptions/3ff3b1de-e7f5-43ad-b057-ace4767e7d01/resourceGroups/AppServiceLH01/providers/Microsoft.Network/loadBalancers/FrontEndServersLoadBalanc
48+
er
49+
Type : Microsoft.Network.Admin/adminLoadBalancers
2950
```
3051

31-
52+
Returns all of the virtual networks.
3253

3354
## PARAMETERS
3455

@@ -45,7 +66,6 @@ Position: Named
4566
Default value: None
4667
Accept pipeline input: False
4768
Accept wildcard characters: False
48-
Dynamic: False
4969
```
5070
5171
### -Filter
@@ -61,7 +81,6 @@ Position: Named
6181
Default value: None
6282
Accept pipeline input: False
6383
Accept wildcard characters: False
64-
Dynamic: False
6584
```
6685
6786
### -InlineCount
@@ -77,7 +96,6 @@ Position: Named
7796
Default value: None
7897
Accept pipeline input: False
7998
Accept wildcard characters: False
80-
Dynamic: False
8199
```
82100
83101
### -OrderBy
@@ -93,7 +111,6 @@ Position: Named
93111
Default value: None
94112
Accept pipeline input: False
95113
Accept wildcard characters: False
96-
Dynamic: False
97114
```
98115
99116
### -Skip
@@ -109,7 +126,6 @@ Position: Named
109126
Default value: None
110127
Accept pipeline input: False
111128
Accept wildcard characters: False
112-
Dynamic: False
113129
```
114130
115131
### -SubscriptionId
@@ -126,7 +142,6 @@ Position: Named
126142
Default value: (Get-AzContext).Subscription.Id
127143
Accept pipeline input: False
128144
Accept wildcard characters: False
129-
Dynamic: False
130145
```
131146
132147
### -Top
@@ -142,7 +157,6 @@ Position: Named
142157
Default value: None
143158
Accept pipeline input: False
144159
Accept wildcard characters: False
145-
Dynamic: False
146160
```
147161
148162
### CommonParameters
@@ -154,9 +168,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
154168
155169
### Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.Api20150615.ILoadBalancer
156170
157-
## ALIASES
158-
159171
## NOTES
160172
173+
ALIASES
174+
161175
## RELATED LINKS
162176

src/Azs.Network.Admin/docs/latest/Get-AzsNetworkAdminOverview.md renamed to src/Azs.Network.Admin/docs/Get-AzsNetworkAdminOverview.md

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,49 @@ Get an overview of the state of the network resource provider.
2828

2929
## EXAMPLES
3030

31-
### -------------------------- EXAMPLE 1 --------------------------
31+
### Example 1: Default Get
3232
```powershell
33-
Get-AzsNetworkAdminOverview
34-
To view examples, please use the -Online parameter with Get-Help or navigate to: https://docs.microsoft.com/en-us/powershell/module/azs.network.admin/get-azsnetworkadminoverview
33+
PS C:\> Get-AzsNetworkAdminOverview
34+
35+
BackendIPUsageInUseResourceCount : 40
36+
BackendIPUsageTotalResourceCount : 282
37+
Id : /subscriptions/3ff3b1de-e7f5-43ad-b057-ace4767e7d01/providers/Microsoft.Network.Admin/adminOverview/
38+
LoadBalancerMuxHealthErrorResourceCount : 0
39+
LoadBalancerMuxHealthHealthyResourceCount : 2
40+
LoadBalancerMuxHealthTotalResourceCount : 2
41+
LoadBalancerMuxHealthUnknownCount : 0
42+
LoadBalancerMuxHealthWarningResourceCount : 0
43+
Location :
44+
MacAddressUsageInUseResourceCount : 95
45+
MacAddressUsageTotalResourceCount : 4063232
46+
Name :
47+
ProvisioningState : Succeeded
48+
PublicIPAddressUsageInUseResourceCount : 65
49+
PublicIPAddressUsageTotalResourceCount : 1023
50+
Tag : Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.Api20150615.ResourceTags
51+
Type : Microsoft.Network.Admin/adminOverview
52+
VirtualGatewayHealthErrorResourceCount : 0
53+
VirtualGatewayHealthHealthyResourceCount : 2
54+
VirtualGatewayHealthTotalResourceCount : 3
55+
VirtualGatewayHealthUnknownCount : 1
56+
VirtualGatewayHealthWarningResourceCount : 0
57+
VirtualNetworkHealthErrorResourceCount : 0
58+
VirtualNetworkHealthHealthyResourceCount : 0
59+
VirtualNetworkHealthTotalResourceCount : 31
60+
VirtualNetworkHealthUnknownCount : 31
61+
VirtualNetworkHealthWarningResourceCount : 0
3562
```
3663

64+
Returns an overview of Network Admin.
3765

66+
### Example 2: Get a specific value
67+
```powershell
68+
PS C:\> (Get-AzsNetworkAdminOverview).BackendIPUsageTotalResourceCount
69+
70+
282
71+
```
72+
73+
Returns the total resource count of the backend IPs.
3874

3975
## PARAMETERS
4076

@@ -51,7 +87,6 @@ Position: Named
5187
Default value: None
5288
Accept pipeline input: False
5389
Accept wildcard characters: False
54-
Dynamic: False
5590
```
5691
5792
### -InputObject
@@ -68,7 +103,6 @@ Position: Named
68103
Default value: None
69104
Accept pipeline input: True (ByValue)
70105
Accept wildcard characters: False
71-
Dynamic: False
72106
```
73107
74108
### -SubscriptionId
@@ -85,7 +119,6 @@ Position: Named
85119
Default value: (Get-AzContext).Subscription.Id
86120
Accept pipeline input: False
87121
Accept wildcard characters: False
88-
Dynamic: False
89122
```
90123
91124
### CommonParameters
@@ -99,14 +132,16 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
99132
100133
### Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.Api20150615.IAdminOverview
101134
102-
## ALIASES
103-
104135
## NOTES
105136
106-
### COMPLEX PARAMETER PROPERTIES
137+
ALIASES
138+
139+
COMPLEX PARAMETER PROPERTIES
140+
107141
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.
108142
109-
#### INPUTOBJECT <INetworkAdminIdentity>: Identity Parameter
143+
144+
INPUTOBJECT <INetworkAdminIdentity>: Identity Parameter
110145
- `[Id <String>]`: Resource identity path
111146
- `[Location <String>]`: Location of the resource.
112147
- `[ResourceName <String>]`: Name of the resource.

0 commit comments

Comments
 (0)