Skip to content

Commit 39158e8

Browse files
Migrate Monitor from generation to main (#23877)
* Move Monitor to main * change log - add monitor data plane * Update ChangeLog.md --------- Co-authored-by: JoyerJin <116236375+JoyerJin@users.noreply.github.com>
1 parent 78de4fe commit 39158e8

File tree

357 files changed

+36143
-883
lines changed

Some content is hidden

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

357 files changed

+36143
-883
lines changed

src/Monitor/ActionGroup.Autorest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ For information on how to develop for `Az.ActionGroup`, see [how-to.md](how-to.m
3232
require:
3333
# readme.azure.noprofile.md is the common configuration file
3434
- $(this-folder)/../../readme.azure.noprofile.md
35-
branch: 47d1d82108a0db0395ed4eca106622becee7fbb4
35+
commit: 47d1d82108a0db0395ed4eca106622becee7fbb4
3636

3737
input-file:
3838
- $(repo)/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/actionGroups_API.json

src/Monitor/ActionGroup.Autorest/generate-portal-ux.ps1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ $instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module]::Ins
4242
$moduleInfo = Get-Module -Name $moduleName
4343
$parameterSetsInfo = Get-Module -Name "$moduleName.private"
4444

45-
$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet")
46-
4745
function Test-FunctionSupported()
4846
{
4947
[CmdletBinding()]
@@ -53,12 +51,12 @@ function Test-FunctionSupported()
5351
$FunctionName
5452
)
5553

56-
If ($buildinfunctions.Contains($FunctionName)) {
54+
If (-not $FunctionName.Contains("_")) {
5755
return $false
5856
}
5957

6058
$cmdletName, $parameterSetName = $FunctionName.Split("_")
61-
If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity")) {
59+
If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity") -or $parameterSetName.Contains("ViaJson")) {
6260
return $false
6361
}
6462
If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) {
@@ -311,7 +309,7 @@ function New-MetadataForCmdlet()
311309
return $result
312310
}
313311

314-
$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) }
312+
$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-FunctionSupported($_) }
315313
$resourceTypes = @{}
316314
foreach ($parameterSetName in $parameterSets)
317315
{

src/Monitor/ActionGroup.Autorest/generated/Module.cs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,20 @@ public partial class Module
2626

2727
public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler();
2828

29+
private static bool _init = false;
30+
31+
private static readonly global::System.Object _initLock = new global::System.Object();
32+
33+
private static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module _instance;
34+
2935
/// <summary>the ISendAsync pipeline instance</summary>
3036
private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.HttpPipeline _pipeline;
3137

3238
/// <summary>the ISendAsync pipeline instance (when proxy is enabled)</summary>
3339
private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.HttpPipeline _pipelineWithProxy;
3440

41+
private static readonly global::System.Object _singletonLock = new global::System.Object();
42+
3543
public bool _useProxy = false;
3644

3745
public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
@@ -51,11 +59,8 @@ public partial class Module
5159
/// <summary>The delegate to get the telemetry Id.</summary>
5260
public GetTelemetryIdDelegate GetTelemetryId { get; set; }
5361

54-
/// <summary>Backing field for <see cref="Instance" /> property.</summary>
55-
private static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module _instance;
56-
5762
/// <summary>the singleton of this module class</summary>
58-
public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module());
63+
public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } }
5964

6065
/// <summary>The Name of this module</summary>
6166
public string Name => @"Az.ActionGroup";
@@ -117,9 +122,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.HttpPipeli
117122
/// <summary>Initialization steps performed after the module is loaded.</summary>
118123
public void Init()
119124
{
120-
OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
121-
OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
122-
CustomInit();
125+
if (_init == false)
126+
{
127+
lock (_initLock) {
128+
if (_init == false) {
129+
OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
130+
OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
131+
CustomInit();
132+
_init = true;
133+
}
134+
}
135+
}
123136
}
124137

125138
/// <summary>Creates the module instance.</summary>

src/Monitor/ActionGroup.Autorest/generated/api/ActionGroup.cs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,6 @@ public partial class ActionGroup
12931293
/// <param name="actionGroupName">The name of the action group.</param>
12941294
/// <param name="body">The receiver to re-enable.</param>
12951295
/// <param name="onOk">a delegate that is called when the remote service returns 200 (OK).</param>
1296-
/// <param name="onConflict">a delegate that is called when the remote service returns 409 (Conflict).</param>
12971296
/// <param name="onDefault">a delegate that is called when the remote service returns default (any response code not handled
12981297
/// elsewhere).</param>
12991298
/// <param name="eventListener">an <see cref="Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener" /> instance that will receive events.</param>
@@ -1302,7 +1301,7 @@ public partial class ActionGroup
13021301
/// <returns>
13031302
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the response is completed.
13041303
/// </returns>
1305-
public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiver(string subscriptionId, string resourceGroupName, string actionGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEnableRequest body, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onOk, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onConflict, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IErrorResponse>, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeUpdate)
1304+
public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiver(string subscriptionId, string resourceGroupName, string actionGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEnableRequest body, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onOk, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IErrorResponse>, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeUpdate)
13061305
{
13071306
var apiVersion = @"2023-01-01";
13081307
// Constant Parameters
@@ -1334,7 +1333,7 @@ public partial class ActionGroup
13341333
request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
13351334
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
13361335
// make the call
1337-
await this.ActionGroupsEnableReceiver_Call (request, onOk,onConflict,onDefault,eventListener,sender);
1336+
await this.ActionGroupsEnableReceiver_Call (request, onOk,onDefault,eventListener,sender);
13381337
}
13391338
}
13401339

@@ -1345,7 +1344,6 @@ public partial class ActionGroup
13451344
/// <param name="viaIdentity"></param>
13461345
/// <param name="body">The receiver to re-enable.</param>
13471346
/// <param name="onOk">a delegate that is called when the remote service returns 200 (OK).</param>
1348-
/// <param name="onConflict">a delegate that is called when the remote service returns 409 (Conflict).</param>
13491347
/// <param name="onDefault">a delegate that is called when the remote service returns default (any response code not handled
13501348
/// elsewhere).</param>
13511349
/// <param name="eventListener">an <see cref="Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener" /> instance that will receive events.</param>
@@ -1354,7 +1352,7 @@ public partial class ActionGroup
13541352
/// <returns>
13551353
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the response is completed.
13561354
/// </returns>
1357-
public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiverViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEnableRequest body, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onOk, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onConflict, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IErrorResponse>, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeUpdate)
1355+
public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiverViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEnableRequest body, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onOk, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IErrorResponse>, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeUpdate)
13581356
{
13591357
var apiVersion = @"2023-01-01";
13601358
// Constant Parameters
@@ -1398,7 +1396,7 @@ public partial class ActionGroup
13981396
request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
13991397
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
14001398
// make the call
1401-
await this.ActionGroupsEnableReceiver_Call (request, onOk,onConflict,onDefault,eventListener,sender);
1399+
await this.ActionGroupsEnableReceiver_Call (request, onOk,onDefault,eventListener,sender);
14021400
}
14031401
}
14041402

@@ -1411,15 +1409,14 @@ public partial class ActionGroup
14111409
/// <param name="actionGroupName">The name of the action group.</param>
14121410
/// <param name="jsonString">Json string supplied to the ActionGroupsEnableReceiver operation</param>
14131411
/// <param name="onOk">a delegate that is called when the remote service returns 200 (OK).</param>
1414-
/// <param name="onConflict">a delegate that is called when the remote service returns 409 (Conflict).</param>
14151412
/// <param name="onDefault">a delegate that is called when the remote service returns default (any response code not handled
14161413
/// elsewhere).</param>
14171414
/// <param name="eventListener">an <see cref="Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener" /> instance that will receive events.</param>
14181415
/// <param name="sender">an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync pipeline to use to make the request.</param>
14191416
/// <returns>
14201417
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the response is completed.
14211418
/// </returns>
1422-
public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiverViaJsonString(string subscriptionId, string resourceGroupName, string actionGroupName, global::System.String jsonString, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onOk, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onConflict, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IErrorResponse>, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender)
1419+
public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiverViaJsonString(string subscriptionId, string resourceGroupName, string actionGroupName, global::System.String jsonString, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onOk, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IErrorResponse>, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender)
14231420
{
14241421
var apiVersion = @"2023-01-01";
14251422
// Constant Parameters
@@ -1451,22 +1448,21 @@ public partial class ActionGroup
14511448
request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
14521449
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
14531450
// make the call
1454-
await this.ActionGroupsEnableReceiver_Call (request, onOk,onConflict,onDefault,eventListener,sender);
1451+
await this.ActionGroupsEnableReceiver_Call (request, onOk,onDefault,eventListener,sender);
14551452
}
14561453
}
14571454

14581455
/// <summary>Actual wire call for <see cref= "ActionGroupsEnableReceiver" /> method.</summary>
14591456
/// <param name="request">the prepared HttpRequestMessage to send.</param>
14601457
/// <param name="onOk">a delegate that is called when the remote service returns 200 (OK).</param>
1461-
/// <param name="onConflict">a delegate that is called when the remote service returns 409 (Conflict).</param>
14621458
/// <param name="onDefault">a delegate that is called when the remote service returns default (any response code not handled
14631459
/// elsewhere).</param>
14641460
/// <param name="eventListener">an <see cref="Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener" /> instance that will receive events.</param>
14651461
/// <param name="sender">an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync pipeline to use to make the request.</param>
14661462
/// <returns>
14671463
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the response is completed.
14681464
/// </returns>
1469-
internal async global::System.Threading.Tasks.Task ActionGroupsEnableReceiver_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onOk, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onConflict, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IErrorResponse>, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender)
1465+
internal async global::System.Threading.Tasks.Task ActionGroupsEnableReceiver_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task> onOk, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IErrorResponse>, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender)
14701466
{
14711467
using( NoSynchronizationContext )
14721468
{
@@ -1488,12 +1484,6 @@ public partial class ActionGroup
14881484
await onOk(_response);
14891485
break;
14901486
}
1491-
case global::System.Net.HttpStatusCode.Conflict:
1492-
{
1493-
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
1494-
await onConflict(_response);
1495-
break;
1496-
}
14971487
default:
14981488
{
14991489
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }

0 commit comments

Comments
 (0)