Skip to content
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
27 changes: 27 additions & 0 deletions src/Dashboard/Dashboard.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// 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 - Dashboard")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.3")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.3")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]

19 changes: 7 additions & 12 deletions src/Dashboard/Dashboard.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ title: Dashboard
module-version: 0.1.0
subject-prefix: Grafana

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:
- from: swagger-document
where: $.definitions.ResourceSku.properties
Expand All @@ -67,7 +59,10 @@ directive:
}
}
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
remove: true
- where:
parameter-name: WorkspaceName
Expand All @@ -88,7 +83,7 @@ directive:
parameter-name: GrafanaIntegrationAzureMonitorWorkspaceIntegration
set:
parameter-name: MonitorWorkspaceIntegration
# The cmdlet's name to long, Re-name it
# - model-cmdlet:
# - AzureMonitorWorkspaceIntegration
- model-cmdlet:
- model-name: AzureMonitorWorkspaceIntegration
cmdlet-name: New-AzGrafanaMonitorWorkspaceIntegrationObject
```
84 changes: 47 additions & 37 deletions src/Dashboard/Dashboard.Autorest/custom/New-AzGrafana.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This API is idempotent, so user can either create a new grafana or update an exi
New-AzGrafana -Name azpstest-grafana -ResourceGroupName azpstest-gp -ApiKey Enabled -AutoGeneratedDomainNameLabelScope 'TenantReuse' -DeterministicOutboundIP 'Enabled' -IdentityType 'SystemAssigned' -Location eastus -PublicNetworkAccess 'Enabled' -SkuName Standard -ZoneRedundancy 'Enabled' -Tag @{"Environment"="Dev"}

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IManagedGrafana
Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IManagedGrafana
.Notes
COMPLEX PARAMETER PROPERTIES

Expand All @@ -37,7 +37,7 @@ GRAFANAINTEGRATIONAZUREMONITORWORKSPACEINTEGRATION <IAzureMonitorWorkspaceIntegr
https://learn.microsoft.com/powershell/module/az.dashboard/new-azgrafana
#>
function New-AzGrafana {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IManagedGrafana])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IManagedGrafana])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand All @@ -61,90 +61,100 @@ param(
# The ID of the target subscription.
${SubscriptionId},

[Parameter(Mandatory)]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ApiKey])]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("Disabled", "Enabled")]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ApiKey]
[System.String]
# The api key setting of the Grafana instance.
${ApiKey},

[Parameter(Mandatory)]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.AutoGeneratedDomainNameLabelScope])]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("TenantReuse")]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.AutoGeneratedDomainNameLabelScope]
[System.String]
# Scope for dns deterministic name hash calculation.
${AutoGeneratedDomainNameLabelScope},

[Parameter(Mandatory)]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.DeterministicOutboundIP])]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("Disabled", "Enabled")]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.DeterministicOutboundIP]
[System.String]
# Whether a Grafana instance uses deterministic outbound IPs.
${DeterministicOutboundIP},

[Parameter(Mandatory)]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ManagedServiceIdentityType])]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ManagedServiceIdentityType]
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
${IdentityType},
[System.Management.Automation.SwitchParameter]
# Determines whether to enable a system-assigned identity for the resource.
${EnableSystemAssignedIdentity},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api30.IUserAssignedIdentities]))]
[System.Collections.Hashtable]
# The set of user assigned identities associated with the resource.
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
# The dictionary values can be empty objects ({}) in requests.
${IdentityUserAssignedIdentity},
[System.String[]]
# The array of user assigned identities associated with the resource.
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
${UserAssignedIdentity},

[Parameter(Mandatory)]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[System.String]
# The geo-location where the grafana resource lives
${Location},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IAzureMonitorWorkspaceIntegration[]]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IAzureMonitorWorkspaceIntegration[]]
# The MonitorWorkspaceIntegration of Azure Managed Grafana.
# To construct, see NOTES section for MONITORWORKSPACEINTEGRATION properties and create a hash table.
${MonitorWorkspaceIntegration},

[Parameter(Mandatory)]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.PublicNetworkAccess])]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("Enabled", "Disabled")]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.PublicNetworkAccess]
[System.String]
# Indicate the state for enable or disable traffic over the public interface.
${PublicNetworkAccess},

[Parameter(Mandatory)]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[System.String]
# The Sku of the grafana resource.
${SkuName},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IManagedGrafanaTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IManagedGrafanaTags]))]
[System.Collections.Hashtable]
# The tags for grafana resource.
${Tag},

[Parameter(Mandatory)]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ZoneRedundancy])]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("Disabled", "Enabled")]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ZoneRedundancy]
[System.String]
# The zone redundancy setting of the Grafana instance.
${ZoneRedundancy},

[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[System.String]
# Path of Json file supplied to the Create operation
${JsonFilePath},

[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
[System.String]
# Json string supplied to the Create operation
${JsonString},

[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Azure')]
[System.Management.Automation.PSObject]
# The credentials, account, tenant, and subscription used for communication with Azure.
# The DefaultProfile parameter is not functional.
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
${DefaultProfile},

[Parameter()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Create an in-memory object for AzureMonitorWorkspaceIntegration.
Create an in-memory object for AzureMonitorWorkspaceIntegration.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.AzureMonitorWorkspaceIntegration
Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.AzureMonitorWorkspaceIntegration
.Link
https://learn.microsoft.com/powershell/module/az.dashboard/new-azgrafanamonitorworkspaceintegrationobject
https://learn.microsoft.com/powershell/module/Az.Dashboard/new-azgrafanamonitorworkspaceintegrationobject
#>
function New-AzGrafanaMonitorWorkspaceIntegrationObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.AzureMonitorWorkspaceIntegration')]
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.AzureMonitorWorkspaceIntegration')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -36,7 +37,7 @@ function New-AzGrafanaMonitorWorkspaceIntegrationObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.AzureMonitorWorkspaceIntegration]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.AzureMonitorWorkspaceIntegration]::New()

if ($PSBoundParameters.ContainsKey('AzureMonitorWorkspaceResourceId')) {
$Object.AzureMonitorWorkspaceResourceId = $AzureMonitorWorkspaceResourceId
Expand Down
5 changes: 3 additions & 2 deletions src/Dashboard/Dashboard.Autorest/docs/Az.Dashboard.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.Dashboard
Module Guid: 8475f339-2250-485a-a9cc-aba350de72d2
Module Guid: d7271e13-06f6-4847-8499-12633a408ce4
Download Help Link: https://learn.microsoft.com/powershell/module/az.dashboard
Help Version: 1.0.0.0
Locale: en-US
Expand All @@ -25,5 +25,6 @@ Create an in-memory object for AzureMonitorWorkspaceIntegration.
Delete a workspace for Grafana resource.

### [Update-AzGrafana](Update-AzGrafana.md)
Update a workspace for Grafana resource.
update a workspace for Grafana resource.
This API is idempotent, so user can either update a new grafana or update an existing grafana.

3 changes: 1 addition & 2 deletions src/Dashboard/Dashboard.Autorest/docs/Get-AzGrafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IDashboardIdentity
Expand Down Expand Up @@ -167,7 +166,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IManagedGrafana
### Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IManagedGrafana

## NOTES

Expand Down
Loading