Skip to content

Commit

Permalink
Move Elastic to main (Azure#26340)
Browse files Browse the repository at this point in the history
Co-authored-by: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com>
  • Loading branch information
1 parent c27c11b commit b0d8d60
Show file tree
Hide file tree
Showing 485 changed files with 67,235 additions and 3,990 deletions.
944 changes: 806 additions & 138 deletions src/Elastic/Elastic.Autorest/Az.Elastic.format.ps1xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Elastic/Elastic.Autorest/Az.Elastic.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.Elastic.private.dll'
FormatsToProcess = './Az.Elastic.format.ps1xml'
FunctionsToExport = 'Get-AzElasticDeploymentInfo', 'Get-AzElasticDetailVMIngestion', 'Get-AzElasticMonitor', 'Get-AzElasticMonitoredResource', 'Get-AzElasticTagRule', 'Get-AzElasticVMHost', 'New-AzElasticFilteringTagObject', 'New-AzElasticMonitor', 'New-AzElasticTagRule', 'Remove-AzElasticMonitor', 'Update-AzElasticMonitor', 'Update-AzElasticVMCollection', '*'
FunctionsToExport = 'Get-AzElasticAllTrafficFilter', 'Get-AzElasticBillingInfo', 'Get-AzElasticConnectedPartnerResource', 'Get-AzElasticDeploymentInfo', 'Get-AzElasticDetailUpgradableVersion', 'Get-AzElasticDetailVMIngestion', 'Get-AzElasticListAssociatedTrafficFilter', 'Get-AzElasticMonitor', 'Get-AzElasticMonitoredResource', 'Get-AzElasticOpenAi', 'Get-AzElasticOpenAiStatus', 'Get-AzElasticOrganizationApiKey', 'Get-AzElasticOrganizationElasticToAzureSubscriptionMapping', 'Get-AzElasticTagRule', 'Get-AzElasticVersion', 'Get-AzElasticVMHost', 'Join-AzElasticAssociateTrafficFilter', 'New-AzElasticCreateAndAssociateIPFilter', 'New-AzElasticCreateAndAssociatePlFilter', 'New-AzElasticExternalUser', 'New-AzElasticFilteringTagObject', 'New-AzElasticMonitor', 'New-AzElasticOpenAi', 'New-AzElasticTagRule', 'Remove-AzElasticDetachAndDeleteTrafficFilter', 'Remove-AzElasticMonitor', 'Remove-AzElasticOpenAi', 'Remove-AzElasticTrafficFilter', 'Update-AzElasticDetachTrafficFilter', 'Update-AzElasticExternalUser', 'Update-AzElasticMonitor', 'Update-AzElasticVMCollection', '*'
AliasesToExport = '*'
PrivateData = @{
PSData = @{
Expand Down
15 changes: 10 additions & 5 deletions src/Elastic/Elastic.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ For information on how to develop for `Az.Elastic`, see [how-to.md](how-to.md).
``` yaml
# lock the commit
commit: eee9cbba738edde2ea48ea0c826f84619e2561df
commit: d38a2c3ce2e2dfc38053af2f6b5fc10cb6221961
tag: package-2024-03-01
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/elastic/resource-manager/Microsoft.Elastic/stable/2020-07-01/elastic.json
- $(repo)/specification/elastic/resource-manager/readme.md
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
# - (this-folder)/relative-path-to-your-local-readme.md

try-require:
- $(repo)/specification/elastic/resource-manager/readme.powershell.md

title: Elastic
module-version: 0.1.0
subject-prefix: $(service-name)
subject-prefix: $elastic

identity-correction-for-post: true
resourcegroup-append: true
Expand Down Expand Up @@ -107,7 +112,7 @@ directive:
parameter-description: The SKU depends on the Elasticsearch Plans available for your account and is a combination of PlanID_Term. \<br>For instance, if the plan ID is "planXYZ" and term is "Yearly", the SKU will be "planXYZ_Yearly". \<br>You may find your eligible plans [here](https://portal.azure.com/#view/Microsoft_Azure_Marketplace/GalleryItemDetailsBladeNopdl/id/elastic.ec-azure-pp/selectionMode~/false/resourceGroupId//resourceGroupLocation//dontDiscardJourney~/false/selectedMenuId/home/launchingContext~/%7B%22galleryItemId%22%3A%22elastic.ec-azure-ppess-consumption-2024%22%2C%22source%22%3A%5B%22GalleryFeaturedMenuItemPart%22%2C%22VirtualizedTileDetails%22%5D%2C%22menuItemId%22%3A%22home%22%2C%22subMenuItemId%22%3A%22Search%20results%22%2C%22telemetryId%22%3A%2262f8ce76-e5e4-4983-9d3e-5c608a0b2bff%22%7D/searchTelemetryId/cca0a8d3-f232-4156-948f-701a5d74a729) or in the online documentation [here](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/elastic.ec-azure-pp) for more details or in case of any issues with the SKU.

- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^UpgradeViaIdentityExpanded$
subject: Monitor|VMCollection|TagRule
remove: true

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"resourceType": "monitors/openAIIntegrations",
"apiVersion": "2024-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elastic"
},
"commands": [
{
"name": "Get-AzElasticOpenAiStatus",
"description": "Get OpenAI integration status for a given integration.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/openAIIntegrations/{integrationName}/getStatus",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elastic/get-azelasticopenaistatus"
},
"parameterSets": [
{
"parameters": [
"-IntegrationName <String>",
"-MonitorName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Get OpenAI integration status for a given integration.",
"parameters": [
{
"name": "-IntegrationName",
"value": "[Path.integrationName]"
},
{
"name": "-MonitorName",
"value": "[Path.monitorName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Get-AzElasticOpenAi",
"description": "Get OpenAI integration rule for a given monitor resource.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/openAIIntegrations/{integrationName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elastic/get-azelasticopenai"
},
"parameterSets": [
{
"parameters": [
"-IntegrationName <String>",
"-MonitorName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Get OpenAI integration rule for a given monitor resource.",
"parameters": [
{
"name": "-IntegrationName",
"value": "[Path.integrationName]"
},
{
"name": "-MonitorName",
"value": "[Path.monitorName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Remove-AzElasticOpenAi",
"description": "Delete OpenAI integration rule for a given monitor resource.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/openAIIntegrations/{integrationName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elastic/remove-azelasticopenai"
},
"parameterSets": [
{
"parameters": [
"-IntegrationName <String>",
"-MonitorName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Delete OpenAI integration rule for a given monitor resource.",
"parameters": [
{
"name": "-IntegrationName",
"value": "[Path.integrationName]"
},
{
"name": "-MonitorName",
"value": "[Path.monitorName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "monitors/tagRules",
"apiVersion": "2020-07-01",
"apiVersion": "2024-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elastic"
},
Expand Down
78 changes: 77 additions & 1 deletion src/Elastic/Elastic.Autorest/UX/Microsoft.Elastic/monitors.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,86 @@
{
"resourceType": "monitors",
"apiVersion": "2020-07-01",
"apiVersion": "2024-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elastic"
},
"commands": [
{
"name": "Get-AzElasticBillingInfo",
"description": "Get marketplace and organization info mapped to the given monitor.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/getBillingInfo",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elastic/get-azelasticbillinginfo"
},
"parameterSets": [
{
"parameters": [
"-MonitorName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Get marketplace and organization info mapped to the given monitor.",
"parameters": [
{
"name": "-MonitorName",
"value": "[Path.monitorName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Get-AzElasticDetailUpgradableVersion",
"description": "List of upgradable versions for a given monitor resource.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listUpgradableVersions",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elastic/get-azelasticdetailupgradableversion"
},
"parameterSets": [
{
"parameters": [
"-MonitorName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "List of upgradable versions for a given monitor resource.",
"parameters": [
{
"name": "-MonitorName",
"value": "[Path.monitorName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Get-AzElasticDetailVMIngestion",
"description": "List the vm ingestion details that will be monitored by the Elastic monitor resource.",
Expand Down
17 changes: 14 additions & 3 deletions src/Elastic/Elastic.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]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [Switch]$DisableAfterBuildTasks)
$ErrorActionPreference = 'Stop'

if($PSEdition -ne 'Core') {
Expand Down Expand Up @@ -67,6 +67,8 @@ if(-not $Isolated -and -not $Debugger) {
$binFolder = Join-Path $PSScriptRoot 'bin'
$objFolder = Join-Path $PSScriptRoot 'obj'

$isAzure = [System.Convert]::ToBoolean('true')

if(-not $Debugger) {
Write-Host -ForegroundColor Green 'Cleaning build folders...'
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
Expand Down Expand Up @@ -143,7 +145,7 @@ if($NoDocs) {
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
}
$null = New-Item -ItemType Directory -Force -Path $docsFolder
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
$addComplexInterfaceInfo = !$isAzure
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
}

Expand All @@ -169,4 +171,13 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

Write-Host -ForegroundColor Green '-------------Done-------------'
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-------------'
4 changes: 2 additions & 2 deletions src/Elastic/Elastic.Autorest/create-model-cmdlets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ function CreateModelCmdlet {
$ObjectType = $Model
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
# remove duplicated module name
if ($ObjectType.StartsWith('Elastic')) {
if ($ObjectType.StartsWith('$elastic')) {
$ModulePrefix = ''
} else {
$ModulePrefix = 'Elastic'
$ModulePrefix = '$elastic'
}
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
Create a in-memory object for FilteringTag
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.Api20200701.FilteringTag
Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.Api20240301.FilteringTag
.Link
https://learn.microsoft.com/powershell/module/az.Elastic/new-AzElasticFilteringTagObject
#>
function New-AzElasticFilteringTagObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.Api20200701.FilteringTag')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.Api20240301.FilteringTag')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -42,7 +42,7 @@
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.Api20200701.FilteringTag]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.Api20240301.FilteringTag]::New()

$Object.Action = $Action
$Object.Name = $Name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Example 1: Get the list of all traffic filters for the account.
```powershell
Get-AzElasticAllTrafficFilter -ResourceGroupName elastic-rg-3eytki -MonitorName elastic-rhqz1v
```

This command will Get the list of all traffic filters for the account.
17 changes: 17 additions & 0 deletions src/Elastic/Elastic.Autorest/examples/Get-AzElasticBillingInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Example 1: Get marketplace info mapped to the given monitor.
```powershell
Get-AzElasticBillingInfo -ResourceGroupName elastic-rg-3eytki -MonitorName elastic-rhqz1v
```

```output
MarketplaceSaaInfoBilledAzureSubscriptionId : 11111111-2222-3333-4444-123456789101
MarketplaceSaaInfoMarketplaceResourceId : /subscriptions/11111111-2222-3333-4444-123456789101/resourceGroups/elastic-rg-3eytki/providers/Microsoft.SaaS/resources/AzElastic_11111111-2222-3333-4444-123456789102_elastic-rhqz1v
MarketplaceSaaInfoMarketplaceStatus : Subscribed
MarketplaceSaaInfoMarketplaceSubscriptionId : 00000000-0000-0000-0000-000000000000
MarketplaceSaaInfoMarketplaceSubscriptionName : AzElastic_11111111-2222-3333-4444-123456789102_elastic-rhqz1v
PartnerBillingEntityOrganizationId : 11111111-2222-3333-4444-123456789103
PartnerBillingEntityOrganizationName : 11111111-2222-3333-4444-123456789103
```

This command gets marketplace info mapped to the given monitor.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Example 1: List of all active deployments linked to the given monitor
```powershell
Get-AzElasticConnectedPartnerResource -ResourceGroupName elastic-rg-3eytki -MonitorName elastic-rhqz1v
```

```output
AccountId AccountName AzureResourceId Location
--------- ----------- --------------- --------
4404219 Account 4404219 /SUBSCRIPTIONS/11111111-2222-3333-4444-123456789101/RESOURCEGROUPS/elastic-rg-3eytki/PROVIDERS/MICROSOFT.ELASTIC/MONITORS/elastic-rhqz1v eastus
```

This command list of all active deployments that are associated with the marketplace subscription linked to the given monitor.

Loading

0 comments on commit b0d8d60

Please sign in to comment.