Skip to content

NetworkCloud 2025-02-01 Stable API : powershell updates #27724

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions src/NetworkCloud/NetworkCloud.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ For information on how to develop for `Az.NetworkCloud`, see [how-to.md](how-to.

```yaml
# pin the swagger version by using the commit id instead of branch name : https://github.com/Azure/azure-rest-api-specs/
# the 2024-07-01 stable in a commit: f999652ecea2a4bddc2b08a113617e23e98f10d4
commit: f999652ecea2a4bddc2b08a113617e23e98f10d4
# the 2025-02-01 stable in a commit: 08973141b0d31a7e75d4dc43a5224a1814a0994f
commit: 08973141b0d31a7e75d4dc43a5224a1814a0994f
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
- $(repo)/specification/networkcloud/resource-manager/readme.md
input-file:
# You need to specify your swagger files here.
- $(repo)/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2024-07-01/networkcloud.json
- $(repo)/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2025-02-01/networkcloud.json

# For new RP, the version is 0.1.0
module-version: 0.1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "bareMetalMachines",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "cloudServicesNetworks",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "clusterManagers",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "clusters/bareMetalMachineKeySets",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "clusters/bmcKeySets",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "clusters/metricsConfigurations",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "clusters",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "kubernetesClusters/agentPools",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "kubernetesClusters/features",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "kubernetesClusters",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "l2Networks",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "l3Networks",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "rackSkus",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "racks",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "storageAppliances",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "trunkedNetworks",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "virtualMachines/consoles",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "virtualMachines",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "volumes",
"apiVersion": "2024-07-01",
"apiVersion": "2025-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.NetworkCloud.private.dll')
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.NetworkCloud.private.dll')

# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.NetworkCloud.internal.psm1'
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.NetworkCloud.internal.psm1'
if(Test-Path $internalModulePath) {
$null = Import-Module -Name $internalModulePath
}
Expand Down
8 changes: 4 additions & 4 deletions src/NetworkCloud/NetworkCloud.Autorest/custom/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Custom
This directory contains custom implementation for non-generated cmdlets for the `Az.NetworkCloud` 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.NetworkCloud.custom.psm1`. This file should not be modified.
This directory contains custom implementation for non-generated cmdlets for the `Az.NetworkCloud` 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.NetworkCloud.custom.psm1`. This file should not be modified.

## Info
- Modifiable: yes
Expand All @@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle
For script cmdlets, these are loaded via the `Az.NetworkCloud.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.
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:
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
Expand All @@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes:
- `Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.DoNotExportAttribute`
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.NetworkCloud`.
- `Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.InternalExportAttribute`
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.NetworkCloud`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
- Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.NetworkCloud`. For more information, see [README.md](../internal/README.md) in the `../internal` folder.
- `Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ProfileAttribute`
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Create an in-memory object for BareMetalMachineConfigurationData.
Create an in-memory object for BareMetalMachineConfigurationData.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BareMetalMachineConfigurationData
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBareMetalMachineConfigurationDataObject
#>
function New-AzNetworkCloudBareMetalMachineConfigurationDataObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BareMetalMachineConfigurationData')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand Down Expand Up @@ -58,7 +58,7 @@ function New-AzNetworkCloudBareMetalMachineConfigurationDataObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BareMetalMachineConfigurationData]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData]::New()

if ($PSBoundParameters.ContainsKey('BmcCredentialsPassword')) {
$Object.BmcCredentialsPassword = $BmcCredentialsPassword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Create an in-memory object for BgpAdvertisement.
Create an in-memory object for BgpAdvertisement.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BgpAdvertisement
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBgpAdvertisementObject
#>
function New-AzNetworkCloudBgpAdvertisementObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BgpAdvertisement')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -46,7 +46,7 @@ function New-AzNetworkCloudBgpAdvertisementObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BgpAdvertisement]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement]::New()

if ($PSBoundParameters.ContainsKey('AdvertiseToFabric')) {
$Object.AdvertiseToFabric = $AdvertiseToFabric
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@ Create an in-memory object for BgpServiceLoadBalancerConfiguration.
Create an in-memory object for BgpServiceLoadBalancerConfiguration.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BgpServiceLoadBalancerConfiguration
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject
#>
function New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BgpServiceLoadBalancerConfiguration')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(HelpMessage="The association of IP address pools to the communities and peers, allowing for announcement of IPs.")]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.IBgpAdvertisement[]]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is reported that the type is unable to find. Could you check again?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$BgpAdvertisement,
[Parameter(HelpMessage="The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.")]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.IServiceLoadBalancerBgpPeer[]]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]]
$BgpPeer,
[Parameter(HelpMessage="The indicator to specify if the load balancer peers with the network fabric.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled])]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled]
$FabricPeeringEnabled,
[Parameter(HelpMessage="The list of pools of IP addresses that can be allocated to load balancer services.")]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.IIPAddressPool[]]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]]
$IPAddressPool
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BgpServiceLoadBalancerConfiguration]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration]::New()

if ($PSBoundParameters.ContainsKey('BgpAdvertisement')) {
$Object.BgpAdvertisement = $BgpAdvertisement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ Create an in-memory object for ControlPlaneNodeConfiguration.
Create an in-memory object for ControlPlaneNodeConfiguration.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.ControlPlaneNodeConfiguration
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudControlPlaneNodeConfigurationObject
#>
function New-AzNetworkCloudControlPlaneNodeConfigurationObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.ControlPlaneNodeConfiguration')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(HelpMessage="The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.")]
[string]
$AdministratorConfigurationAdminUsername,
[Parameter(HelpMessage="The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.")]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.ISshPublicKey[]]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]]
$AdministratorConfigurationSshPublicKey,
[Parameter(HelpMessage="The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. If not specified, all availability zones will be used.")]
[string[]]
Expand All @@ -48,7 +48,7 @@ function New-AzNetworkCloudControlPlaneNodeConfigurationObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.ControlPlaneNodeConfiguration]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration]::New()

if ($PSBoundParameters.ContainsKey('AdministratorConfigurationAdminUsername')) {
$Object.AdministratorConfigurationAdminUsername = $AdministratorConfigurationAdminUsername
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ Create an in-memory object for EgressEndpoint.
Create an in-memory object for EgressEndpoint.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.EgressEndpoint
Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudEgressEndpointObject
#>
function New-AzNetworkCloudEgressEndpointObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.EgressEndpoint')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(Mandatory, HelpMessage="The descriptive category name of endpoints accessible by the AKS agent node. For example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use the category 'default'.")]
[string]
$Category,
[Parameter(Mandatory, HelpMessage="The list of endpoint dependencies.")]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.IEndpointDependency[]]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency[]]
$Endpoint
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.EgressEndpoint]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint]::New()

if ($PSBoundParameters.ContainsKey('Category')) {
$Object.Category = $Category
Expand Down
Loading
Loading