Skip to content

Commit 90e0032

Browse files
azure-pipelines[bot]azure-powershell-botVeryEarly
authored
Migrate AksArc from generation to main (#25673)
* Move AksArc to main * Update ChangeLog.md --------- Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Yabo Hu <[email protected]>
1 parent 445805b commit 90e0032

28 files changed

+689
-106
lines changed

src/AksArc/AksArc.Autorest/custom/Invoke-AzAksArcClusterUpgrade.ps1

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,9 @@ function Invoke-AzAksArcClusterUpgrade {
121121
if ($PSBoundParameters.ContainsKey("KubernetesVersion"))
122122
{
123123
$Upgrades = Get-AzAksArcClusterUpgrade -ClusterName $ClusterName -ResourceGroupName $ResourceGroupName -SubscriptionId $SubscriptionId
124-
if ($upgrades.ControlPlaneProfileUpgrade.KubernetesVersion -contains $KubernetesVersion) {
125-
continue
126-
} else {
124+
if (!($upgrades.ControlPlaneProfileUpgrade.KubernetesVersion -contains $KubernetesVersion)) {
127125
throw "Kubernetes Version $KubernetesVersion is not a valid upgradable version."
128-
}
126+
}
129127
} else {
130128
$Upgrades = Get-AzAksArcClusterUpgrade -ClusterName $ClusterName -ResourceGroupName $ResourceGroupName -SubscriptionId $SubscriptionId
131129
$UpgradeListLength = $upgrades.ControlPlaneProfileUpgrade.KubernetesVersion.Length
@@ -137,8 +135,7 @@ function Invoke-AzAksArcClusterUpgrade {
137135

138136
$null = $PSBoundParameters.Add("KubernetesVersion", $LatestUpgrade)
139137
}
140-
138+
141139
Az.AksArc.internal\Update-AzAksArcCluster @PSBoundParameters
142140
}
143-
}
144-
141+
}

src/AksArc/AksArc.Autorest/custom/New-AzAksArcCluster.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ function New-AzAksArcCluster {
475475
$null = $PSBoundParameters.Add("LicenseProfileAzureHybridBenefit", $false)
476476
}
477477
$null = $PSBoundParameters.Remove("EnableAzureHybridBenefit")
478+
$null = $PSBoundParameters.Remove("NodeTaint")
479+
$null = $PSBoundParameters.Remove("NodeLabel")
478480
Az.AksArc.internal\New-AzAksArcCluster @PSBoundParameters
479481
}
480482
}

src/AksArc/AksArc.Autorest/generated/api/AksArc.cs

Lines changed: 194 additions & 52 deletions
Large diffs are not rendered by default.

src/AksArc/AksArc.Autorest/generated/cmdlets/RemoveAzAksArcCluster_Delete.cs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ public partial class RemoveAzAksArcCluster_Delete : global::System.Management.Au
176176

177177
partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow);
178178

179+
/// <summary>
180+
/// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens
181+
/// on that response. Implement this method in a partial class to enable this behavior
182+
/// </summary>
183+
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
184+
/// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return
185+
/// immediately (set to true to skip further processing )</param>
186+
187+
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow);
188+
179189
/// <summary>
180190
/// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet)
181191
/// </summary>
@@ -428,7 +438,7 @@ protected override void ProcessRecord()
428438
try
429439
{
430440
await ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
431-
await this.Client.ProvisionedClusterInstancesDelete(ConnectedClusterResourceUri, onNoContent, onDefault, this, Pipeline);
441+
await this.Client.ProvisionedClusterInstancesDelete(ConnectedClusterResourceUri, onNoContent, onOk, onDefault, this, Pipeline);
432442
await ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
433443
}
434444
catch (Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.UndeclaredResponseException urexception)
@@ -540,5 +550,29 @@ protected override void StopProcessing()
540550
}
541551
}
542552
}
553+
554+
/// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
555+
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
556+
/// <returns>
557+
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
558+
/// </returns>
559+
private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage)
560+
{
561+
using( NoSynchronizationContext )
562+
{
563+
var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false);
564+
overrideOnOk(responseMessage, ref _returnNow);
565+
// if overrideOnOk has returned true, then return right away.
566+
if ((null != _returnNow && await _returnNow))
567+
{
568+
return ;
569+
}
570+
// onOk - response for 200 /
571+
if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
572+
{
573+
WriteObject(true);
574+
}
575+
}
576+
}
543577
}
544578
}

src/AksArc/AksArc.Autorest/generated/cmdlets/RemoveAzAksArcNodepool_Delete.cs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,16 @@ public partial class RemoveAzAksArcNodepool_Delete : global::System.Management.A
191191

192192
partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow);
193193

194+
/// <summary>
195+
/// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens
196+
/// on that response. Implement this method in a partial class to enable this behavior
197+
/// </summary>
198+
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
199+
/// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return
200+
/// immediately (set to true to skip further processing )</param>
201+
202+
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow);
203+
194204
/// <summary>
195205
/// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet)
196206
/// </summary>
@@ -444,7 +454,7 @@ protected override void ProcessRecord()
444454
try
445455
{
446456
await ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
447-
await this.Client.AgentPoolDelete(ConnectedClusterResourceUri, Name, onNoContent, onDefault, this, Pipeline);
457+
await this.Client.AgentPoolDelete(ConnectedClusterResourceUri, Name, onNoContent, onOk, onDefault, this, Pipeline);
448458
await ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
449459
}
450460
catch (Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.UndeclaredResponseException urexception)
@@ -556,5 +566,29 @@ protected override void StopProcessing()
556566
}
557567
}
558568
}
569+
570+
/// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
571+
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
572+
/// <returns>
573+
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
574+
/// </returns>
575+
private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage)
576+
{
577+
using( NoSynchronizationContext )
578+
{
579+
var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false);
580+
overrideOnOk(responseMessage, ref _returnNow);
581+
// if overrideOnOk has returned true, then return right away.
582+
if ((null != _returnNow && await _returnNow))
583+
{
584+
return ;
585+
}
586+
// onOk - response for 200 /
587+
if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
588+
{
589+
WriteObject(true);
590+
}
591+
}
592+
}
559593
}
560594
}

src/AksArc/AksArc.Autorest/generated/cmdlets/RemoveAzAksArcNodepool_DeleteViaIdentity.cs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,16 @@ public partial class RemoveAzAksArcNodepool_DeleteViaIdentity : global::System.M
168168

169169
partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow);
170170

171+
/// <summary>
172+
/// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens
173+
/// on that response. Implement this method in a partial class to enable this behavior
174+
/// </summary>
175+
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
176+
/// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return
177+
/// immediately (set to true to skip further processing )</param>
178+
179+
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow);
180+
171181
/// <summary>
172182
/// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet)
173183
/// </summary>
@@ -421,7 +431,7 @@ protected override void ProcessRecord()
421431
await ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
422432
if (InputObject?.Id != null)
423433
{
424-
await this.Client.AgentPoolDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline);
434+
await this.Client.AgentPoolDeleteViaIdentity(InputObject.Id, onNoContent, onOk, onDefault, this, Pipeline);
425435
}
426436
else
427437
{
@@ -434,7 +444,7 @@ protected override void ProcessRecord()
434444
{
435445
ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AgentPoolName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) );
436446
}
437-
await this.Client.AgentPoolDelete(InputObject.ConnectedClusterResourceUri ?? null, InputObject.AgentPoolName ?? null, onNoContent, onDefault, this, Pipeline);
447+
await this.Client.AgentPoolDelete(InputObject.ConnectedClusterResourceUri ?? null, InputObject.AgentPoolName ?? null, onNoContent, onOk, onDefault, this, Pipeline);
438448
}
439449
await ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
440450
}
@@ -547,5 +557,29 @@ protected override void StopProcessing()
547557
}
548558
}
549559
}
560+
561+
/// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
562+
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
563+
/// <returns>
564+
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
565+
/// </returns>
566+
private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage)
567+
{
568+
using( NoSynchronizationContext )
569+
{
570+
var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false);
571+
overrideOnOk(responseMessage, ref _returnNow);
572+
// if overrideOnOk has returned true, then return right away.
573+
if ((null != _returnNow && await _returnNow))
574+
{
575+
return ;
576+
}
577+
// onOk - response for 200 /
578+
if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
579+
{
580+
WriteObject(true);
581+
}
582+
}
583+
}
550584
}
551585
}

src/AksArc/AksArc.Autorest/generated/cmdlets/RemoveAzAksArcVirtualNetwork_Delete.cs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ public partial class RemoveAzAksArcVirtualNetwork_Delete : global::System.Manage
207207

208208
partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow);
209209

210+
/// <summary>
211+
/// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens
212+
/// on that response. Implement this method in a partial class to enable this behavior
213+
/// </summary>
214+
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
215+
/// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return
216+
/// immediately (set to true to skip further processing )</param>
217+
218+
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow);
219+
210220
/// <summary>
211221
/// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet)
212222
/// </summary>
@@ -461,7 +471,7 @@ protected override void ProcessRecord()
461471
try
462472
{
463473
await ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
464-
await this.Client.VirtualNetworksDelete(SubscriptionId, ResourceGroupName, Name, onNoContent, onDefault, this, Pipeline);
474+
await this.Client.VirtualNetworksDelete(SubscriptionId, ResourceGroupName, Name, onNoContent, onOk, onDefault, this, Pipeline);
465475
await ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
466476
}
467477
catch (Microsoft.Azure.PowerShell.Cmdlets.AksArc.Runtime.UndeclaredResponseException urexception)
@@ -573,5 +583,29 @@ protected override void StopProcessing()
573583
}
574584
}
575585
}
586+
587+
/// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
588+
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
589+
/// <returns>
590+
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
591+
/// </returns>
592+
private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage)
593+
{
594+
using( NoSynchronizationContext )
595+
{
596+
var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false);
597+
overrideOnOk(responseMessage, ref _returnNow);
598+
// if overrideOnOk has returned true, then return right away.
599+
if ((null != _returnNow && await _returnNow))
600+
{
601+
return ;
602+
}
603+
// onOk - response for 200 /
604+
if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
605+
{
606+
WriteObject(true);
607+
}
608+
}
609+
}
576610
}
577611
}

0 commit comments

Comments
 (0)