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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
706 changes: 629 additions & 77 deletions src/SelfHelp/SelfHelp.Autorest/Az.SelfHelp.format.ps1xml

Large diffs are not rendered by default.

160 changes: 21 additions & 139 deletions src/SelfHelp/SelfHelp.Autorest/Az.SelfHelp.psd1
Original file line number Diff line number Diff line change
@@ -1,142 +1,24 @@
#
# Module manifest for module 'Az.SelfHelp'
#
# Generated by: Microsoft Corporation
#
# Generated on: 11/10/2023
#

@{

# Script module or binary module file associated with this manifest.
RootModule = './Az.SelfHelp.psm1'

# Version number of this module.
ModuleVersion = '0.1.1'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

# ID used to uniquely identify this module
GUID = '2705ffd2-39d8-491f-b0c6-14fca2dc3727'

# Author of this module
Author = 'Microsoft Corporation'

# Company or vendor of this module
CompanyName = 'Microsoft Corporation'

# Copyright statement for this module
Copyright = 'Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Microsoft Azure PowerShell: SelfHelp cmdlets'

# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '5.1'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
DotNetFrameworkVersion = '4.7.2'

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.13.2'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = './bin/Az.SelfHelp.private.dll'

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = './Az.SelfHelp.format.ps1xml'

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Get-AzSelfHelpDiagnostic', 'Get-AzSelfHelpDiscoverySolution',
'Get-AzSelfHelpSolution', 'Get-AzSelfHelpTroubleshooter',
'Invoke-AzSelfHelpCheckNameAvailability',
'Invoke-AzSelfHelpContinueTroubleshooter',
'New-AzSelfHelpDiagnostic', 'New-AzSelfHelpSolution',
'New-AzSelfHelpTroubleshooter', 'Restart-AzSelfHelpTroubleshooter',
'Stop-AzSelfHelpTroubleshooter', 'Update-AzSelfHelpSolution'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

# Variables to export from this module
# VariablesToExport = @()

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = '*'

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

GUID = '2705ffd2-39d8-491f-b0c6-14fca2dc3727'
RootModule = './Az.SelfHelp.psm1'
ModuleVersion = '0.1.0'
CompatiblePSEditions = 'Core', 'Desktop'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = 'Microsoft Corporation. All rights reserved.'
Description = 'Microsoft Azure PowerShell: SelfHelp cmdlets'
PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.SelfHelp.private.dll'
FormatsToProcess = './Az.SelfHelp.format.ps1xml'
FunctionsToExport = 'Get-AzSelfHelpDiagnostic', 'Get-AzSelfHelpDiscoverySolution', 'Get-AzSelfHelpSimplifiedSolution', 'Get-AzSelfHelpSolution', 'Get-AzSelfHelpSolutionSelfHelp', 'Get-AzSelfHelpTroubleshooter', 'Invoke-AzSelfHelpCheckNameAvailability', 'Invoke-AzSelfHelpContinueTroubleshooter', 'Invoke-AzSelfHelpDiscoverySolutionNlpSubscriptionScope', 'Invoke-AzSelfHelpDiscoverySolutionNlpTenantScope', 'Invoke-AzSelfHelpWarmSolutionUp', 'New-AzSelfHelpDiagnostic', 'New-AzSelfHelpSimplifiedSolution', 'New-AzSelfHelpSolution', 'New-AzSelfHelpTroubleshooter', 'Restart-AzSelfHelpTroubleshooter', 'Stop-AzSelfHelpTroubleshooter', 'Update-AzSelfHelpSolution', '*'
AliasesToExport = '*'
PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'Azure','ResourceManager','ARM','PSModule','SelfHelp'

# A URL to the license for this module.
LicenseUri = 'https://aka.ms/azps-license'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/Azure/azure-powershell'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Added support for discovery API as the first point of entry in Help RP.
* Added support for new solution types (Diagnostics, Azure Solutions, Troubleshooters) in preview
* Enabled customers to access Azure curated, relevant self-help solutions including diagnostics and Azure solutions at the resource and subscription scopes.
* Implemented filter parameters such as solutionType, problemClassificationId/problemId, resourceId, and resourceType to enable customers to get more granular results through discovery API.
* Enabled customers to trigger one or more applicable solutions such as diagnostics, components within Azure solutions, and Troubleshooters'

# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = @()

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'SelfHelp'
LicenseUri = 'https://aka.ms/azps-license'
ProjectUri = 'https://github.com/Azure/azure-powershell'
ReleaseNotes = ''
}
}
}

24 changes: 14 additions & 10 deletions src/SelfHelp/SelfHelp.Autorest/Az.SelfHelp.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,41 @@

# Ask for the shared functionality table
$VTable = Register-AzModule

# Tweaks the pipeline on module load
$instance.OnModuleLoad = $VTable.OnModuleLoad

# Following two delegates are added for telemetry
$instance.GetTelemetryId = $VTable.GetTelemetryId
$instance.Telemetry = $VTable.Telemetry


# Delegate to sanitize the output object
$instance.SanitizeOutput = $VTable.SanitizerHandler

# Delegate to get the telemetry info
$instance.GetTelemetryInfo = $VTable.GetTelemetryInfo

# Tweaks the pipeline per call
$instance.OnNewRequest = $VTable.OnNewRequest

# Gets shared parameter values
$instance.GetParameterValue = $VTable.GetParameterValue

# Allows shared module to listen to events from this module
$instance.EventListener = $VTable.EventListener

# Gets shared argument completers
$instance.ArgumentCompleter = $VTable.ArgumentCompleter

# The name of the currently selected Azure profile
$instance.ProfileName = $VTable.ProfileName


# Load the custom module
$customModulePath = Join-Path $PSScriptRoot './custom/Az.SelfHelp.custom.psm1'
if(Test-Path $customModulePath) {
$null = Import-Module -Name $customModulePath
}

# Export nothing to clear implicit exports
Export-ModuleMember

Expand All @@ -97,12 +101,12 @@
# Load the last folder if no profile is selected
$profileDirectory = $directories | Select-Object -Last 1
}

if($profileDirectory) {
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
$exportsPath = $profileDirectory.FullName
}

if($exportsPath) {
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
Expand Down
9 changes: 6 additions & 3 deletions src/SelfHelp/SelfHelp.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
This directory contains the PowerShell module for the SelfHelp service.

---

## Info
- Modifiable: yes
- Generated: all
Expand All @@ -30,10 +29,10 @@ For information on how to develop for `Az.SelfHelp`, see [how-to.md](how-to.md).

```yaml
# pin the swagger version by using the commit id instead of branch name
branch: 270eeb7a7883e0ad4e183e809fb67c6551d0eaa0
commit: 1145a0df0f91b5f0f1f5ab66667899a61eda5e2b
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../readme.azure.noprofile.md
- $(this-folder)/../../readme.azure.noprofile.md
- $(repo)/specification/help/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)/azure-rest-api-specs/specification/help/resource-manager/readme.md
Expand All @@ -53,6 +52,10 @@ subject-prefix: $(service-name)
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:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "diagnostics",
"apiVersion": "2023-09-01-preview",
"apiVersion": "2024-03-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp"
},
Expand Down
37 changes: 37 additions & 0 deletions src/SelfHelp/SelfHelp.Autorest/UX/Microsoft.Help/selfHelp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"resourceType": "selfHelp",
"apiVersion": "2024-03-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp"
},
"commands": [
{
"name": "Get-AzSelfHelpSolutionSelfHelp",
"description": "Finds and Executes a Self Help Solution based on the Solution Id.\nThese are static self help content to help users troubleshoot their issues.",
"path": "/providers/Microsoft.Help/selfHelp/{solutionId}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp/get-azselfhelpsolutionselfhelp"
},
"parameterSets": [
{
"parameters": [
"-SolutionId <String>"
]
}
]
},
"examples": [
{
"description": "Finds and Executes a Self Help Solution based on the Solution Id. These are static self help content to help users troubleshoot their issues.",
"parameters": [
{
"name": "-SolutionId",
"value": "[Path.solutionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"resourceType": "simplifiedSolutions",
"apiVersion": "2024-03-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp"
},
"commands": [
{
"name": "Get-AzSelfHelpSimplifiedSolution",
"description": "Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions.",
"path": "/{scope}/providers/Microsoft.Help/simplifiedSolutions/{simplifiedSolutionsResourceName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp/get-azselfhelpsimplifiedsolution"
},
"parameterSets": [
{
"parameters": [
"-SResourceName <String>",
"-Scope <String>"
]
}
]
},
"examples": [
{
"description": "Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions.",
"parameters": [
{
"name": "-SResourceName",
"value": "[Path.simplifiedSolutionsResourceName]"
},
{
"name": "-Scope",
"value": "[Path.scope]"
}
]
}
]
}
]
}
35 changes: 34 additions & 1 deletion src/SelfHelp/SelfHelp.Autorest/UX/Microsoft.Help/solutions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "solutions",
"apiVersion": "2023-09-01-preview",
"apiVersion": "2024-03-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp"
},
Expand Down Expand Up @@ -37,6 +37,39 @@
]
}
]
},
{
"name": "Invoke-AzSelfHelpWarmSolutionUp",
"description": "Warm up the solution resource by preloading asynchronous diagnostics results into cache",
"path": "/{scope}/providers/Microsoft.Help/solutions/{solutionResourceName}/warmup",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp/invoke-azselfhelpwarmsolutionup"
},
"parameterSets": [
{
"parameters": [
"-Scope <String>",
"-SolutionResourceName <String>"
]
}
]
},
"examples": [
{
"description": "Warm up the solution resource by preloading asynchronous diagnostics results into cache",
"parameters": [
{
"name": "-Scope",
"value": "[Path.scope]"
},
{
"name": "-SolutionResourceName",
"value": "[Path.solutionResourceName]"
}
]
}
]
}
]
}
Loading