Skip to content

Commit ad0dde5

Browse files
JoyerJinnotyashhh
authored andcommitted
[PS] Migrate SelfHelp module to autorest v4 (#27839)
1 parent 75badb2 commit ad0dde5

File tree

47 files changed

+1295
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1295
-373
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
13+
14+
using System;
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - SelfHelp")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.2.1")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.2.1")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/SelfHelp/SelfHelp.Autorest/README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,19 @@ module-version: 0.1.0
4646
title: SelfHelp
4747
subject-prefix: $(service-name)
4848

49-
# If there are post APIs for some kinds of actions in the RP, you may need to
50-
# uncomment following line to support viaIdentity for these post APIs
51-
# identity-correction-for-post: true
52-
resourcegroup-append: true
53-
nested-object-to-string: true
54-
55-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
56-
use-extension:
57-
"@autorest/powershell": "3.x"
58-
5949
directive:
6050
# Following is two common directive which are normally required in all the RPs
6151
# 1. Remove the unexpanded parameter set
6252
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
6353
- where:
64-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
54+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
6555
remove: true
6656
# Remove the set-* cmdlet
6757
- where:
6858
verb: Set
6959
remove: true
60+
- where:
61+
verb: Update
62+
subject: Diagnostic|SimplifiedSolution|Troubleshooter
63+
remove: true
7064
```

src/SelfHelp/SelfHelp.Autorest/UX/Microsoft.Help/solutions.json

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,6 @@
3737
]
3838
}
3939
]
40-
},
41-
{
42-
"name": "Invoke-AzSelfHelpWarmSolutionUp",
43-
"description": "Warm up the solution resource by preloading asynchronous diagnostics results into cache",
44-
"path": "/{scope}/providers/Microsoft.Help/solutions/{solutionResourceName}/warmup",
45-
"help": {
46-
"learnMore": {
47-
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp/invoke-azselfhelpwarmsolutionup"
48-
},
49-
"parameterSets": [
50-
{
51-
"parameters": [
52-
"-Scope <String>",
53-
"-SolutionResourceName <String>"
54-
]
55-
}
56-
]
57-
},
58-
"examples": [
59-
{
60-
"description": "Warm up the solution resource by preloading asynchronous diagnostics results into cache",
61-
"parameters": [
62-
{
63-
"name": "-Scope",
64-
"value": "[Path.scope]"
65-
},
66-
{
67-
"name": "-SolutionResourceName",
68-
"value": "[Path.solutionResourceName]"
69-
}
70-
]
71-
}
72-
]
7340
}
7441
]
7542
}

src/SelfHelp/SelfHelp.Autorest/UX/Microsoft.Help/troubleshooters.json

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"commands": [
88
{
99
"name": "Get-AzSelfHelpTroubleshooter",
10-
"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.",
10+
"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.",
1111
"path": "/{scope}/providers/Microsoft.Help/troubleshooters/{troubleshooterName}",
1212
"help": {
1313
"learnMore": {
@@ -24,7 +24,7 @@
2424
},
2525
"examples": [
2626
{
27-
"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.",
27+
"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.",
2828
"parameters": [
2929
{
3030
"name": "-Name",
@@ -38,39 +38,6 @@
3838
}
3939
]
4040
},
41-
{
42-
"name": "Invoke-AzSelfHelpContinueTroubleshooter",
43-
"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.",
44-
"path": "/{scope}/providers/Microsoft.Help/troubleshooters/{troubleshooterName}/continue",
45-
"help": {
46-
"learnMore": {
47-
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp/invoke-azselfhelpcontinuetroubleshooter"
48-
},
49-
"parameterSets": [
50-
{
51-
"parameters": [
52-
"-Scope <String>",
53-
"-TroubleshooterName <String>"
54-
]
55-
}
56-
]
57-
},
58-
"examples": [
59-
{
60-
"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.",
61-
"parameters": [
62-
{
63-
"name": "-Scope",
64-
"value": "[Path.scope]"
65-
},
66-
{
67-
"name": "-TroubleshooterName",
68-
"value": "[Path.troubleshooterName]"
69-
}
70-
]
71-
}
72-
]
73-
},
7441
{
7542
"name": "Restart-AzSelfHelpTroubleshooter",
7643
"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.",

src/SelfHelp/SelfHelp.Autorest/docs/Az.SelfHelp.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.SelfHelp
3-
Module Guid: 2705ffd2-39d8-491f-b0c6-14fca2dc3727
3+
Module Guid: 7d65b6ab-a31c-4bd0-a352-36f483643432
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.selfhelp
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -30,15 +30,15 @@ These are static self help content to help users troubleshoot their issues.
3030

3131
### [Get-AzSelfHelpTroubleshooter](Get-AzSelfHelpTroubleshooter.md)
3232
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.
33-
This API requires the Troubleshooter resource name that was created using the Create API.
33+
This API requires the Troubleshooter resource name that was created using the get API.
3434

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

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

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

5252
### [New-AzSelfHelpDiagnostic](New-AzSelfHelpDiagnostic.md)
53-
Creates a diagnostic for the specific resource using solutionId and requiredInputs* from discovery solutions.
53+
create a diagnostic for the specific resource using solutionId and requiredInputs* from discovery solutions.
5454
\<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.
5555

5656
### [New-AzSelfHelpSimplifiedSolution](New-AzSelfHelpSimplifiedSolution.md)
57-
Creates a simplified Solutions for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
57+
create a simplified Solutions for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
5858
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.
5959
\<br/\>\<br/\> \<b\>Note:\</b\> \<br/\>1.
6060
‘requiredInputs’ from Discovery solutions response must be passed via ‘parameters’ in the request body of simplified Solutions API.
6161
\<br/\>
6262

6363
### [New-AzSelfHelpSolution](New-AzSelfHelpSolution.md)
64-
Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
64+
create a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
6565
\<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.
6666
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.
6767
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area.
@@ -74,7 +74,7 @@ In the absence of the ‘requiredParameters’ it is likely that some of the sol
7474
‘requiredParameters’ from the Solutions response is the same as ‘properties.parameters’ in the request for Troubleshooters
7575

7676
### [New-AzSelfHelpTroubleshooter](New-AzSelfHelpTroubleshooter.md)
77-
Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
77+
create the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
7878
\<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.
7979
Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes.
8080
These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers.
@@ -88,5 +88,5 @@ The old resource name is obsolete after this API is invoked.
8888
Ends the troubleshooter action
8989

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

src/SelfHelp/SelfHelp.Autorest/docs/Get-AzSelfHelpDiagnostic.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ Accept wildcard characters: False
6161
6262
### -InputObject
6363
Identity Parameter
64-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
6564
6665
```yaml
6766
Type: Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISelfHelpIdentity
@@ -114,7 +113,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
114113
115114
## OUTPUTS
116115
117-
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.IDiagnosticResource
116+
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.IDiagnosticResource
118117
119118
## NOTES
120119

src/SelfHelp/SelfHelp.Autorest/docs/Get-AzSelfHelpDiscoverySolution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
9797
9898
## OUTPUTS
9999
100-
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.ISolutionMetadataResource
100+
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISolutionMetadataResource
101101
102102
## NOTES
103103

src/SelfHelp/SelfHelp.Autorest/docs/Get-AzSelfHelpSimplifiedSolution.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ Accept wildcard characters: False
6464
6565
### -InputObject
6666
Identity Parameter
67-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
6867
6968
```yaml
7069
Type: Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISelfHelpIdentity
@@ -117,7 +116,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
117116
118117
## OUTPUTS
119118
120-
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.ISimplifiedSolutionsResource
119+
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISimplifiedSolutionsResource
121120
122121
## NOTES
123122

src/SelfHelp/SelfHelp.Autorest/docs/Get-AzSelfHelpSolution.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ Accept wildcard characters: False
6161
6262
### -InputObject
6363
Identity Parameter
64-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
6564
6665
```yaml
6766
Type: Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISelfHelpIdentity
@@ -114,7 +113,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
114113
115114
## OUTPUTS
116115
117-
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.ISolutionResource
116+
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISolutionResource
118117
119118
## NOTES
120119

src/SelfHelp/SelfHelp.Autorest/docs/Get-AzSelfHelpSolutionSelfHelp.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ Accept wildcard characters: False
6464
6565
### -InputObject
6666
Identity Parameter
67-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
6867
6968
```yaml
7069
Type: Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISelfHelpIdentity
@@ -103,7 +102,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
103102
104103
## OUTPUTS
105104
106-
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.Api20240301Preview.ISolutionResourceSelfHelp
105+
### Microsoft.Azure.PowerShell.Cmdlets.SelfHelp.Models.ISolutionResourceSelfHelp
107106
108107
## NOTES
109108

0 commit comments

Comments
 (0)