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

Migrate Monitor from generation to main #26124

Merged
merged 2 commits into from
Sep 20, 2024
Merged
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
12 changes: 11 additions & 1 deletion src/Monitor/ActionGroup.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
$ErrorActionPreference = 'Stop'

if($PSEdition -ne 'Core') {
Expand Down Expand Up @@ -177,4 +177,14 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

if (-not $DisableAfterBuildTasks){
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
Write-Host -ForegroundColor Green 'Running after build tasks...'
. $afterBuildTasksPath @afterBuildTasksArgs
}
}


Write-Host -ForegroundColor Green '-------------Done-------------'
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### Example 1: create action group logic app receiver
```powershell
New-AzActionGroupLogicAppReceiverObject -CallbackUrl "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w" -Name "sample logic app" -ResourceId "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp"
New-AzActionGroupLogicAppReceiverObject -CallbackUrl "https://p*****7w" -Name "sample logic app" -ResourceId "/subscriptions/{subId}/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp"
```

```output
CallbackUrl Name ResourceId
----------- ---- ----------
https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w sample logic app /subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/provid…
CallbackUrl Name ResourceId
----------- ---- ----------
https://p*****7w sample logic app /subscriptions/{subId}/resourceGroups/LogicApp/provid…
```

This command creates action group logic app receiver object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create a new action group or Create an existing one.
Create a new action group or update an existing one.
.Description
Create a new action group or Create an existing one.
Create a new action group or update an existing one.
.Example
$email1 = New-AzActionGroupEmailReceiverObject -EmailAddress [email protected] -Name user1
$sms1 = New-AzActionGroupSmsReceiverObject -CountryCode '{countrycode}' -Name user2 -PhoneNumber '{phonenumber}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Create an in-memory object for LogicAppReceiver.
.Description
Create an in-memory object for LogicAppReceiver.
.Example
New-AzActionGroupLogicAppReceiverObject -CallbackUrl "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w" -Name "sample logic app" -ResourceId "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp"
New-AzActionGroupLogicAppReceiverObject -CallbackUrl "https://p*****7w" -Name "sample logic app" -ResourceId "/subscriptions/{subId}/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp"

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.LogicAppReceiver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,9 @@ end {

<#
.Synopsis
Copy link
Contributor

Choose a reason for hiding this comment

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

affected by New-AzActionGroupLogicAppReceiverObject.md

Create a new action group or Create an existing one.
Create a new action group or update an existing one.
.Description
Create a new action group or Create an existing one.
Create a new action group or update an existing one.
.Example
$email1 = New-AzActionGroupEmailReceiverObject -EmailAddress [email protected] -Name user1
$sms1 = New-AzActionGroupSmsReceiverObject -CountryCode '{countrycode}' -Name user2 -PhoneNumber '{phonenumber}'
Expand Down Expand Up @@ -1056,9 +1056,9 @@ end {

<#
.Synopsis
Update a new action group or Update an existing one.
Update a new action group or update an existing one.
.Description
Update a new action group or Update an existing one.
Update a new action group or update an existing one.
.Example
$enventhub = New-AzActionGroupEventHubReceiverObject -EventHubName "testEventHub" -EventHubNameSpace "actiongrouptest" -Name "sample eventhub" -SubscriptionId '{subid}'
Update-AzActionGroup -Name actiongroup1 -ResourceGroupName monitor-action -EventHubReceiver $enventhub
Expand Down Expand Up @@ -2296,7 +2296,7 @@ Create an in-memory object for LogicAppReceiver.
.Description
Create an in-memory object for LogicAppReceiver.
.Example
New-AzActionGroupLogicAppReceiverObject -CallbackUrl "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w" -Name "sample logic app" -ResourceId "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp"
New-AzActionGroupLogicAppReceiverObject -CallbackUrl "https://p*****7w" -Name "sample logic app" -ResourceId "/subscriptions/{subId}/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp"

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.LogicAppReceiver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Update a new action group or Update an existing one.
Update a new action group or update an existing one.
.Description
Update a new action group or Update an existing one.
Update a new action group or update an existing one.
.Example
$enventhub = New-AzActionGroupEventHubReceiverObject -EventHubName "testEventHub" -EventHubNameSpace "actiongrouptest" -Name "sample eventhub" -SubscriptionId '{subid}'
Update-AzActionGroup -Name actiongroup1 -ResourceGroupName monitor-action -EventHubReceiver $enventhub
Expand Down
24 changes: 16 additions & 8 deletions src/Monitor/ActionGroup.Autorest/generated/api/ActionGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ public partial class ActionGroup
var _finalUri = _response.GetFirstHeader(@"Location");
var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
var location = _response.GetFirstHeader(@"Location");
var operationLocation = _response.GetFirstHeader(@"Operation-Location");
while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
{
// delay before making the next polling request
Expand All @@ -365,7 +366,10 @@ public partial class ActionGroup
if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
location = _response.GetFirstHeader(@"Location");
}
var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) {
operationLocation = _response.GetFirstHeader(@"Operation-Location");
}
var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation;
request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Method.Get);

// and let's look at the current response body and see if we have some information we can give back to the listener
Expand Down Expand Up @@ -506,6 +510,7 @@ public partial class ActionGroup
var _finalUri = _response.GetFirstHeader(@"Location");
var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
var location = _response.GetFirstHeader(@"Location");
var operationLocation = _response.GetFirstHeader(@"Operation-Location");
while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
{
// delay before making the next polling request
Expand All @@ -518,7 +523,10 @@ public partial class ActionGroup
if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
location = _response.GetFirstHeader(@"Location");
}
var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) {
operationLocation = _response.GetFirstHeader(@"Operation-Location");
}
var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation;
request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Method.Get);

// and let's look at the current response body and see if we have some information we can give back to the listener
Expand Down Expand Up @@ -644,7 +652,7 @@ public partial class ActionGroup
}
}

/// <summary>Update a new action group or Update an existing one.</summary>
/// <summary>Update a new action group or update an existing one.</summary>
/// <param name="subscriptionId">The ID of the target subscription.</param>
/// <param name="resourceGroupName">The name of the resource group. The name is case insensitive.</param>
/// <param name="actionGroupName">The name of the action group.</param>
Expand Down Expand Up @@ -694,7 +702,7 @@ public partial class ActionGroup
}
}

/// <summary>Update a new action group or Update an existing one.</summary>
/// <summary>Update a new action group or update an existing one.</summary>
/// <param name="viaIdentity"></param>
/// <param name="body">The action group to create or use for the update.</param>
/// <param name="onOk">a delegate that is called when the remote service returns 200 (OK).</param>
Expand Down Expand Up @@ -754,7 +762,7 @@ public partial class ActionGroup
}
}

/// <summary>Update a new action group or Update an existing one.</summary>
/// <summary>Update a new action group or update an existing one.</summary>
/// <param name="viaIdentity"></param>
/// <param name="body">The action group to create or use for the update.</param>
/// <param name="eventListener">an <see cref="Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener" /> instance that will receive events.</param>
Expand Down Expand Up @@ -811,7 +819,7 @@ public partial class ActionGroup
}
}

/// <summary>Update a new action group or Update an existing one.</summary>
/// <summary>Update a new action group or update an existing one.</summary>
/// <param name="subscriptionId">The ID of the target subscription.</param>
/// <param name="resourceGroupName">The name of the resource group. The name is case insensitive.</param>
/// <param name="actionGroupName">The name of the action group.</param>
Expand Down Expand Up @@ -860,7 +868,7 @@ public partial class ActionGroup
}
}

/// <summary>Update a new action group or Update an existing one.</summary>
/// <summary>Update a new action group or update an existing one.</summary>
/// <param name="subscriptionId">The ID of the target subscription.</param>
/// <param name="resourceGroupName">The name of the resource group. The name is case insensitive.</param>
/// <param name="actionGroupName">The name of the action group.</param>
Expand Down Expand Up @@ -906,7 +914,7 @@ public partial class ActionGroup
}
}

/// <summary>Update a new action group or Update an existing one.</summary>
/// <summary>Update a new action group or update an existing one.</summary>
/// <param name="subscriptionId">The ID of the target subscription.</param>
/// <param name="resourceGroupName">The name of the resource group. The name is case insensitive.</param>
/// <param name="actionGroupName">The name of the action group.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Cmdlets
using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Cmdlets;
using System;

/// <summary>Create a new action group or Create an existing one.</summary>
/// <summary>Create a new action group or update an existing one.</summary>
/// <remarks>
/// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}"
/// </remarks>
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActionGroup_CreateExpanded", SupportsShouldProcess = true)]
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IActionGroupResource))]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Description(@"Create a new action group or Create an existing one.")]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Description(@"Create a new action group or update an existing one.")]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Generated]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}", ApiVersion = "2023-01-01")]
public partial class NewAzActionGroup_CreateExpanded : global::System.Management.Automation.PSCmdlet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Cmdlets
using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Cmdlets;
using System;

/// <summary>Create a new action group or Create an existing one.</summary>
/// <summary>Create a new action group or update an existing one.</summary>
/// <remarks>
/// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}"
/// </remarks>
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActionGroup_CreateViaIdentityExpanded", SupportsShouldProcess = true)]
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IActionGroupResource))]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Description(@"Create a new action group or Create an existing one.")]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Description(@"Create a new action group or update an existing one.")]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Generated]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}", ApiVersion = "2023-01-01")]
public partial class NewAzActionGroup_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Cmdlets
using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Cmdlets;
using System;

/// <summary>Create a new action group or Create an existing one.</summary>
/// <summary>Create a new action group or update an existing one.</summary>
/// <remarks>
/// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}"
/// </remarks>
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActionGroup_CreateViaJsonFilePath", SupportsShouldProcess = true)]
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IActionGroupResource))]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Description(@"Create a new action group or Create an existing one.")]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Description(@"Create a new action group or update an existing one.")]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Generated]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}", ApiVersion = "2023-01-01")]
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.NotSuggestDefaultParameterSet]
Expand Down
Loading