Skip to content

[PS] Migrate SelfHelp module to autorest v4 #27839

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

Merged
merged 1 commit into from
May 27, 2025
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
26 changes: 26 additions & 0 deletions src/SelfHelp/SelfHelp.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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 - SelfHelp")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.2.1")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.2.1")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
16 changes: 5 additions & 11 deletions src/SelfHelp/SelfHelp.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,19 @@ module-version: 0.1.0
title: SelfHelp
subject-prefix: $(service-name)

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
# 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:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
# Remove the set-* cmdlet
- where:
verb: Set
remove: true
- where:
verb: Update
subject: Diagnostic|SimplifiedSolution|Troubleshooter
remove: true
```
33 changes: 0 additions & 33 deletions src/SelfHelp/SelfHelp.Autorest/UX/Microsoft.Help/solutions.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,6 @@
]
}
]
},
{
"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]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"commands": [
{
"name": "Get-AzSelfHelpTroubleshooter",
"description": "Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.<br/> Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow.\nThis API requires the Troubleshooter resource name that was created using the Create API.",
"description": "Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.<br/> Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow.\nThis API requires the Troubleshooter resource name that was created using the get API.",
"path": "/{scope}/providers/Microsoft.Help/troubleshooters/{troubleshooterName}",
"help": {
"learnMore": {
Expand All @@ -24,7 +24,7 @@
},
"examples": [
{
"description": "Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.<br/> Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the Create API.",
"description": "Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.<br/> Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the get API.",
"parameters": [
{
"name": "-Name",
Expand All @@ -38,39 +38,6 @@
}
]
},
{
"name": "Invoke-AzSelfHelpContinueTroubleshooter",
"description": "Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.\n<br/>Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process.\nThis API is used after the Troubleshooter has been created using the Create API.",
"path": "/{scope}/providers/Microsoft.Help/troubleshooters/{troubleshooterName}/continue",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp/invoke-azselfhelpcontinuetroubleshooter"
},
"parameterSets": [
{
"parameters": [
"-Scope <String>",
"-TroubleshooterName <String>"
]
}
]
},
"examples": [
{
"description": "Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name. <br/>Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process. This API is used after the Troubleshooter has been created using the Create API.",
"parameters": [
{
"name": "-Scope",
"value": "[Path.scope]"
},
{
"name": "-TroubleshooterName",
"value": "[Path.troubleshooterName]"
}
]
}
]
},
{
"name": "Restart-AzSelfHelpTroubleshooter",
"description": "Restarts the troubleshooter API using applicable troubleshooter resource name as the input.<br/> It returns new resource name which should be used in subsequent request.\nThe old resource name is obsolete after this API is invoked.",
Expand Down
16 changes: 8 additions & 8 deletions src/SelfHelp/SelfHelp.Autorest/docs/Az.SelfHelp.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.SelfHelp
Module Guid: 2705ffd2-39d8-491f-b0c6-14fca2dc3727
Module Guid: 7d65b6ab-a31c-4bd0-a352-36f483643432
Download Help Link: https://learn.microsoft.com/powershell/module/az.selfhelp
Help Version: 1.0.0.0
Locale: en-US
Expand Down Expand Up @@ -30,15 +30,15 @@ These are static self help content to help users troubleshoot their issues.

### [Get-AzSelfHelpTroubleshooter](Get-AzSelfHelpTroubleshooter.md)
Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.\<br/\> Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow.
This API requires the Troubleshooter resource name that was created using the Create API.
This API requires the Troubleshooter resource name that was created using the get API.

### [Invoke-AzSelfHelpCheckNameAvailability](Invoke-AzSelfHelpCheckNameAvailability.md)
This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions

### [Invoke-AzSelfHelpContinueTroubleshooter](Invoke-AzSelfHelpContinueTroubleshooter.md)
Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
\<br/\>Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process.
This API is used after the Troubleshooter has been created using the Create API.
This API is used after the Troubleshooter has been created using the continue API.

### [Invoke-AzSelfHelpDiscoverySolutionNlpSubscriptionScope](Invoke-AzSelfHelpDiscoverySolutionNlpSubscriptionScope.md)
Solution discovery using natural language processing.
Expand All @@ -50,18 +50,18 @@ Solution discovery using natural language processing.
Warm up the solution resource by preloading asynchronous diagnostics results into cache

### [New-AzSelfHelpDiagnostic](New-AzSelfHelpDiagnostic.md)
Creates a diagnostic for the specific resource using solutionId and requiredInputs* from discovery solutions.
create a diagnostic for the specific resource using solutionId and requiredInputs* from discovery solutions.
\<br/\>Diagnostics are powerful solutions that access product resources or other relevant data and provide the root cause of the issue and the steps to address the issue.\<br/\>\<br/\> \<b\>Note: \</b\> ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics API.

### [New-AzSelfHelpSimplifiedSolution](New-AzSelfHelpSimplifiedSolution.md)
Creates a simplified Solutions for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
create a simplified Solutions for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
In the absence of the ‘Parameters’ it is likely that some of the simplified Solutions might fail execution, and you might see an empty response.
\<br/\>\<br/\> \<b\>Note:\</b\> \<br/\>1.
‘requiredInputs’ from Discovery solutions response must be passed via ‘parameters’ in the request body of simplified Solutions API.
\<br/\>

### [New-AzSelfHelpSolution](New-AzSelfHelpSolution.md)
Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
create a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
\<br/\> Azure solutions comprise a comprehensive library of self-help resources that have been thoughtfully curated by Azure engineers to aid customers in resolving typical troubleshooting issues.
These solutions encompass (1.) dynamic and context-aware diagnostics, guided troubleshooting wizards, and data visualizations, (2.) rich instructional video tutorials and illustrative diagrams and images, and (3.) thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area.
Expand All @@ -74,7 +74,7 @@ In the absence of the ‘requiredParameters’ it is likely that some of the sol
‘requiredParameters’ from the Solutions response is the same as ‘properties.parameters’ in the request for Troubleshooters

### [New-AzSelfHelpTroubleshooter](New-AzSelfHelpTroubleshooter.md)
Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
create the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
\<br/\> Azure Troubleshooters help with hard to classify issues, reducing the gap between customer observed problems and solutions by guiding the user effortlessly through the troubleshooting process.
Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes.
These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers.
Expand All @@ -88,5 +88,5 @@ The old resource name is obsolete after this API is invoked.
Ends the troubleshooter action

### [Update-AzSelfHelpSolution](Update-AzSelfHelpSolution.md)
Update the requiredInputs or additional information needed to execute the solution
update the requiredInputs or additional information needed to execute the solution

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,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.SelfHelp.Models.ISelfHelpIdentity
Expand Down Expand Up @@ -114,7 +113,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.IDiagnosticResource
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.IDiagnosticResource

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.ISolutionMetadataResource
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISolutionMetadataResource

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,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.SelfHelp.Models.ISelfHelpIdentity
Expand Down Expand Up @@ -117,7 +116,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.ISimplifiedSolutionsResource
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISimplifiedSolutionsResource

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,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.SelfHelp.Models.ISelfHelpIdentity
Expand Down Expand Up @@ -114,7 +113,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.ISolutionResource
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISolutionResource

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,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.SelfHelp.Models.ISelfHelpIdentity
Expand Down Expand Up @@ -103,7 +102,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.ISolutionResourceSelfHelp
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISolutionResourceSelfHelp

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ schema: 2.0.0

## SYNOPSIS
Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.\<br/\> Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow.
This API requires the Troubleshooter resource name that was created using the Create API.
This API requires the Troubleshooter resource name that was created using the get API.

## SYNTAX

Expand All @@ -26,7 +26,7 @@ Get-AzSelfHelpTroubleshooter -InputObject <ISelfHelpIdentity> [-DefaultProfile <

## DESCRIPTION
Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.\<br/\> Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow.
This API requires the Troubleshooter resource name that was created using the Create API.
This API requires the Troubleshooter resource name that was created using the get API.

## EXAMPLES

Expand Down Expand Up @@ -65,7 +65,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.SelfHelp.Models.ISelfHelpIdentity
Expand Down Expand Up @@ -118,7 +117,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.ITroubleshooterResource
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ITroubleshooterResource

## NOTES

Expand Down
Loading