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

[PS] Migrate NetworkCloud module to autorest v4 #27399

Open
wants to merge 1 commit 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
2 changes: 2 additions & 0 deletions src/NetworkCloud/NetworkCloud.Autorest/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ generated
internal
exports
tools
custom/*.psm1
custom/autogen-model-cmdlets
test/*-TestResults.xml
license.txt
/*.ps1
Expand Down
26 changes: 26 additions & 0 deletions src/NetworkCloud/NetworkCloud.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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.

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - NetworkCloud")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.1.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.1.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
45 changes: 19 additions & 26 deletions src/NetworkCloud/NetworkCloud.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,15 @@ title: NetworkCloud
service-name: NetworkCloud
subject-prefix: NetworkCloud

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
identity-correction-for-post: true
resourcegroup-append: true
nested-object-to-string: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^Cordon$|^CordonViaIdentity$|^DeployViaIdentity$|^Deploy$|^Enable$|^EnableViaIdentity$|^Replace$|^ReplaceViaIdentity$|^Run$|^RunViaIdentity$|^PowerOff$|^PowerOffViaIdentity$
variant: ^(Create|Update|Cordon|Deploy|Enable|Replace|Run|PowerOff)(?!.*?Expanded)
remove: true
- where:
variant: ^CreateViaIdentity.*$
remove: true
- where:
subject: KuberneteClusterNode
Expand Down Expand Up @@ -269,19 +262,19 @@ directive:

# Add model-cmdlet for any properties/sub-properties of complex type
- model-cmdlet:
- BareMetalMachineConfigurationData
- BgpAdvertisement
- BgpServiceLoadBalancerConfiguration
- ControlPlaneNodeConfiguration
- EgressEndpoint
- EndpointDependency
- InitialAgentPoolConfiguration
- IpAddressPool
- KeySetUser
- L3NetworkAttachmentConfiguration
- NetworkAttachment
- RackDefinition
- ServiceLoadBalancerBgpPeer
- StorageApplianceConfigurationData
- VirtualMachinePlacementHint
- model-name: BareMetalMachineConfigurationData
- model-name: BgpAdvertisement
- model-name: BgpServiceLoadBalancerConfiguration
- model-name: ControlPlaneNodeConfiguration
- model-name: EgressEndpoint
- model-name: EndpointDependency
- model-name: InitialAgentPoolConfiguration
- model-name: IpAddressPool
- model-name: KeySetUser
- model-name: L3NetworkAttachmentConfiguration
- model-name: NetworkAttachment
- model-name: RackDefinition
- model-name: ServiceLoadBalancerBgpPeer
- model-name: StorageApplianceConfigurationData
- model-name: VirtualMachinePlacementHint
```
Original file line number Diff line number Diff line change
Expand Up @@ -43,82 +43,6 @@
}
]
},
{
"name": "Invoke-AzNetworkCloudClusterContinueVersionUpdate",
"description": "Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud/invoke-aznetworkcloudclustercontinueversionupdate"
},
"parameterSets": [
{
"parameters": [
"-ClusterName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update.",
"parameters": [
{
"name": "-ClusterName",
"value": "[Path.clusterName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Invoke-AzNetworkCloudScanClusterRuntime",
"description": "Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster configuration.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.networkcloud/invoke-aznetworkcloudscanclusterruntime"
},
"parameterSets": [
{
"parameters": [
"-ClusterName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster configuration.",
"parameters": [
{
"name": "-ClusterName",
"value": "[Path.clusterName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Remove-AzNetworkCloudCluster",
"description": "Delete the provided cluster.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ 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.BareMetalMachineConfigurationData
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBareMetalMachineConfigurationDataObject
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudbaremetalmachineconfigurationdataobject
#>
function New-AzNetworkCloudBareMetalMachineConfigurationDataObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BareMetalMachineConfigurationData')]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationData')]
[CmdletBinding(PositionalBinding=$false)]
Param(

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

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

if ($PSBoundParameters.ContainsKey('BmcCredentialsPassword')) {
$Object.BmcCredentialsPassword = $BmcCredentialsPassword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ 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.BgpAdvertisement
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBgpAdvertisementObject
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudbgpadvertisementobject
#>
function New-AzNetworkCloudBgpAdvertisementObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BgpAdvertisement')]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisement')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(HelpMessage="The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric])]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")]
[string]
$AdvertiseToFabric,
[Parameter(HelpMessage="The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format.")]
[string[]]
$Community,
[Parameter(Mandatory, HelpMessage="The names of the IP address pools associated with this announcement.")]
[Parameter(HelpMessage="The names of the IP address pools associated with this announcement.")]
[string[]]
$IPAddressPool,
[Parameter(HelpMessage="The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement.")]
Expand All @@ -46,7 +47,7 @@ function New-AzNetworkCloudBgpAdvertisementObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BgpAdvertisement]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.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,33 @@ 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.BgpServiceLoadBalancerConfiguration
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudbgpserviceloadbalancerconfigurationobject
#>
function New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.BgpServiceLoadBalancerConfiguration')]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.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.IBgpAdvertisement[]]
$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.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]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")]
[string]
$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.IIPAddressPool[]]
$IPAddressPool
)

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

if ($PSBoundParameters.ContainsKey('BgpAdvertisement')) {
$Object.BgpAdvertisement = $BgpAdvertisement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,35 @@ 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.ControlPlaneNodeConfiguration
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudControlPlaneNodeConfigurationObject
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudcontrolplanenodeconfigurationobject
#>
function New-AzNetworkCloudControlPlaneNodeConfigurationObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.ControlPlaneNodeConfiguration')]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.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.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[]]
$AvailabilityZone,
[Parameter(Mandatory, HelpMessage="The number of virtual machines that use this configuration.")]
[long]
$Count,
[Parameter(Mandatory, HelpMessage="The name of the VM SKU supplied during creation.")]
[Parameter(HelpMessage="The name of the VM SKU supplied during creation.")]
[string]
$VMSkuName
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.ControlPlaneNodeConfiguration]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.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,26 @@ 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.EgressEndpoint
.Link
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudEgressEndpointObject
https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudegressendpointobject
#>
function New-AzNetworkCloudEgressEndpointObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20240701.EgressEndpoint')]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.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.IEndpointDependency[]]
$Endpoint
)

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

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

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

Expand All @@ -39,7 +40,7 @@ function New-AzNetworkCloudEndpointDependencyObject {
)

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

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