diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 9670f5475e91..94da2c36b15e 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -16963,7 +16963,7 @@ packages: dev: false file:projects/arm-selfhelp.tgz: - resolution: {integrity: sha512-hM45/ZgPc1eNuyYttBGawKFbCJYQ58ILyzluuI+I3mYZFW0pN60g75eFb0eKW15BB3GO+7uuPRK1XKzI7bkJ0w==, tarball: file:projects/arm-selfhelp.tgz} + resolution: {integrity: sha512-Vk2mQPeI/oX5UQbqyv/ZnFTGjWnqvGsf25Syfj4/O15WY6WYHnVahTjGGRYv0PwZ9fBBuRfMnSwu9jXK3XNq7A==, tarball: file:projects/arm-selfhelp.tgz} name: '@rush-temp/arm-selfhelp' version: 0.0.0 dependencies: @@ -16984,6 +16984,7 @@ packages: rimraf: 5.0.5 ts-node: 10.9.2(@types/node@18.19.32)(typescript@5.4.5) tslib: 2.6.2 + tsx: 4.9.3 typescript: 5.4.5 uglify-js: 3.17.4 transitivePeerDependencies: diff --git a/sdk/selfhelp/arm-selfhelp/CHANGELOG.md b/sdk/selfhelp/arm-selfhelp/CHANGELOG.md index 03042d8bce1e..7e707570677d 100644 --- a/sdk/selfhelp/arm-selfhelp/CHANGELOG.md +++ b/sdk/selfhelp/arm-selfhelp/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 2.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 2.0.0-beta.3 (2024-04-19) + +## 2.0.0-beta.4 (2024-05-07) **Features** @@ -128,195 +118,8 @@ - Interface SolutionMetadataResource no longer has parameter solutionType - Type of parameter provisioningState of interface DiagnosticResource is changed from ProvisioningState to DiagnosticProvisioningState - Removed Enum KnownProvisioningState - - -## 2.0.0-beta.2 (2023-12-04) -**Features** - - - Added operation group CheckNameAvailability - - Added operation group Solution - - Added operation group Troubleshooters - - Added Interface AutomatedCheckResult - - Added Interface CheckNameAvailabilityPostOptionalParams - - Added Interface ContinueRequestBody - - Added Interface Filter - - Added Interface FilterGroup - - Added Interface MetricsBasedChart - - Added Interface ReplacementMaps - - Added Interface ResponseOption - - Added Interface ResponseValidationProperties - - Added Interface RestartTroubleshooterResponse - - Added Interface SearchResult - - Added Interface Section - - Added Interface SolutionCreateOptionalParams - - Added Interface SolutionGetOptionalParams - - Added Interface SolutionMetadataProperties - - Added Interface SolutionPatchRequestBody - - Added Interface SolutionResource - - Added Interface SolutionsDiagnostic - - Added Interface SolutionsTroubleshooters - - Added Interface SolutionUpdateHeaders - - Added Interface SolutionUpdateOptionalParams - - Added Interface Step - - Added Interface StepInput - - Added Interface TriggerCriterion - - Added Interface TroubleshooterResource - - Added Interface TroubleshooterResponse - - Added Interface TroubleshootersContinueHeaders - - Added Interface TroubleshootersContinueOptionalParams - - Added Interface TroubleshootersCreateOptionalParams - - Added Interface TroubleshootersEndHeaders - - Added Interface TroubleshootersEndOptionalParams - - Added Interface TroubleshootersGetOptionalParams - - Added Interface TroubleshootersRestartHeaders - - Added Interface TroubleshootersRestartOptionalParams - - Added Interface Video - - Added Interface VideoGroup - - Added Interface VideoGroupVideo - - Added Interface WebResult - - Added Type Alias AggregationType - - Added Type Alias AutomatedCheckResultType - - Added Type Alias CheckNameAvailabilityPostResponse - - Added Type Alias Confidence - - Added Type Alias DiagnosticProvisioningState - - Added Type Alias ExecutionStatus - - Added Type Alias Name - - Added Type Alias QuestionContentType - - Added Type Alias QuestionType - - Added Type Alias ResultType - - Added Type Alias SolutionCreateResponse - - Added Type Alias SolutionGetResponse - - Added Type Alias SolutionProvisioningState - - Added Type Alias SolutionType - - Added Type Alias SolutionUpdateResponse - - Added Type Alias TroubleshooterProvisioningState - - Added Type Alias TroubleshootersContinueResponse - - Added Type Alias TroubleshootersCreateResponse - - Added Type Alias TroubleshootersEndResponse - - Added Type Alias TroubleshootersGetResponse - - Added Type Alias TroubleshootersRestartResponse - - Added Type Alias Type - - Interface SolutionMetadataResource has a new optional parameter solutions - - Added Enum KnownAggregationType - - Added Enum KnownAutomatedCheckResultType - - Added Enum KnownConfidence - - Added Enum KnownDiagnosticProvisioningState - - Added Enum KnownExecutionStatus - - Added Enum KnownName - - Added Enum KnownQuestionContentType - - Added Enum KnownQuestionType - - Added Enum KnownResultType - - Added Enum KnownSolutionProvisioningState - - Added Enum KnownSolutionType - - Added Enum KnownTroubleshooterProvisioningState - - Added Enum KnownType - -**Breaking Changes** - - - Removed operation Diagnostics.checkNameAvailability - - Interface SolutionMetadataResource no longer has parameter description - - Interface SolutionMetadataResource no longer has parameter requiredParameterSets - - Interface SolutionMetadataResource no longer has parameter solutionId - - Interface SolutionMetadataResource no longer has parameter solutionType - - Type of parameter provisioningState of interface DiagnosticResource is changed from ProvisioningState to DiagnosticProvisioningState - - Removed Enum KnownProvisioningState - - -## 2.0.0-beta.1 (2023-10-24) - -**Features** - - - Added operation group CheckNameAvailability - - Added operation group Solution - - Added operation group Troubleshooters - - Added Interface AutomatedCheckResult - - Added Interface CheckNameAvailabilityPostOptionalParams - - Added Interface ContinueRequestBody - - Added Interface Filter - - Added Interface FilterGroup - - Added Interface MetricsBasedChart - - Added Interface ReplacementMaps - - Added Interface ResponseOption - - Added Interface ResponseValidationProperties - - Added Interface RestartTroubleshooterResponse - - Added Interface SearchResult - - Added Interface Section - - Added Interface SolutionCreateOptionalParams - - Added Interface SolutionGetOptionalParams - - Added Interface SolutionMetadataProperties - - Added Interface SolutionPatchRequestBody - - Added Interface SolutionResource - - Added Interface SolutionResourceProperties - - Added Interface SolutionsDiagnostic - - Added Interface SolutionsTroubleshooters - - Added Interface SolutionUpdateHeaders - - Added Interface SolutionUpdateOptionalParams - - Added Interface Step - - Added Interface StepInput - - Added Interface TriggerCriterion - - Added Interface TroubleshooterResource - - Added Interface TroubleshooterResponse - - Added Interface TroubleshootersContinueHeaders - - Added Interface TroubleshootersContinueOptionalParams - - Added Interface TroubleshootersCreateOptionalParams - - Added Interface TroubleshootersEndHeaders - - Added Interface TroubleshootersEndOptionalParams - - Added Interface TroubleshootersGetOptionalParams - - Added Interface TroubleshootersRestartHeaders - - Added Interface TroubleshootersRestartOptionalParams - - Added Interface Video - - Added Interface VideoGroup - - Added Interface VideoGroupVideo - - Added Interface WebResult - - Added Type Alias AggregationType - - Added Type Alias AutomatedCheckResultType - - Added Type Alias CheckNameAvailabilityPostResponse - - Added Type Alias Confidence - - Added Type Alias DiagnosticProvisioningState - - Added Type Alias ExecutionStatus - - Added Type Alias Name - - Added Type Alias QuestionContentType - - Added Type Alias QuestionType - - Added Type Alias ResultType - - Added Type Alias SolutionCreateResponse - - Added Type Alias SolutionGetResponse - - Added Type Alias SolutionProvisioningState - - Added Type Alias SolutionType - - Added Type Alias SolutionUpdateResponse - - Added Type Alias TroubleshooterProvisioningState - - Added Type Alias TroubleshootersContinueResponse - - Added Type Alias TroubleshootersCreateResponse - - Added Type Alias TroubleshootersEndResponse - - Added Type Alias TroubleshootersGetResponse - - Added Type Alias TroubleshootersRestartResponse - - Added Type Alias Type - - Interface SolutionMetadataResource has a new optional parameter solutions - - Added Enum KnownAggregationType - - Added Enum KnownAutomatedCheckResultType - - Added Enum KnownConfidence - - Added Enum KnownDiagnosticProvisioningState - - Added Enum KnownExecutionStatus - - Added Enum KnownName - - Added Enum KnownQuestionContentType - - Added Enum KnownQuestionType - - Added Enum KnownResultType - - Added Enum KnownSolutionProvisioningState - - Added Enum KnownSolutionType - - Added Enum KnownTroubleshooterProvisioningState - - Added Enum KnownType - -**Breaking Changes** - - - Removed operation Diagnostics.checkNameAvailability - - Interface SolutionMetadataResource no longer has parameter description - - Interface SolutionMetadataResource no longer has parameter requiredParameterSets - - Interface SolutionMetadataResource no longer has parameter solutionId - - Interface SolutionMetadataResource no longer has parameter solutionType - - Type of parameter provisioningState of interface DiagnosticResource is changed from ProvisioningState to DiagnosticProvisioningState - - Removed Enum KnownProvisioningState - ## 1.0.0 (2023-06-20) -The package of @azure/arm-selfhelp is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-selfhelp is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/selfhelp/arm-selfhelp/_meta.json b/sdk/selfhelp/arm-selfhelp/_meta.json index 273566d39e0c..dcba8fa4bd97 100644 --- a/sdk/selfhelp/arm-selfhelp/_meta.json +++ b/sdk/selfhelp/arm-selfhelp/_meta.json @@ -1,8 +1,8 @@ { - "commit": "db6282dd0d04c5f13375e98e88b09d04c2009ae8", + "commit": "f920f9ae0ce81c4a3a748dea3e509d3fd3c05ba7", "readme": "specification/help/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\help\\resource-manager\\readme.md --use=@autorest/typescript@6.0.20 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/help/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.5", - "use": "@autorest/typescript@6.0.20" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.8", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/assets.json b/sdk/selfhelp/arm-selfhelp/assets.json deleted file mode 100644 index 57ba70dd4e6d..000000000000 --- a/sdk/selfhelp/arm-selfhelp/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/selfhelp/arm-selfhelp", - "Tag": "js/selfhelp/arm-selfhelp_56bdb44654" -} diff --git a/sdk/selfhelp/arm-selfhelp/package.json b/sdk/selfhelp/arm-selfhelp/package.json index 9ebd86f281e3..5297eb60890b 100644 --- a/sdk/selfhelp/arm-selfhelp/package.json +++ b/sdk/selfhelp/arm-selfhelp/package.json @@ -40,6 +40,7 @@ "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", "@types/mocha": "^10.0.0", + "tsx": "^4.7.1", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", @@ -105,13 +106,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-selfhelp?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp" +} \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md b/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md index 556373ef59b1..5c548eac5b75 100644 --- a/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md +++ b/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md @@ -169,7 +169,7 @@ export type DiscoverySolutionListResponse = DiscoveryResponse; // @public export interface DiscoverySolutionNLPSubscriptionScope { - post(options?: DiscoverySolutionNLPSubscriptionScopePostOptionalParams): Promise; + post(subscriptionId: string, options?: DiscoverySolutionNLPSubscriptionScopePostOptionalParams): Promise; } // @public @@ -243,7 +243,6 @@ export function getContinuationToken(page: unknown): string | undefined; export class HelpRP extends coreClient.ServiceClient { // (undocumented) $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: HelpRPOptionalParams); constructor(credentials: coreAuth.TokenCredential, options?: HelpRPOptionalParams); // (undocumented) apiVersion: string; @@ -266,8 +265,6 @@ export class HelpRP extends coreClient.ServiceClient { // (undocumented) solutionSelfHelp: SolutionSelfHelp; // (undocumented) - subscriptionId?: string; - // (undocumented) troubleshooters: Troubleshooters; } diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/checkNameAvailabilityPostSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/checkNameAvailabilityPostSample.ts deleted file mode 100644 index 2c3f8b060b08..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/checkNameAvailabilityPostSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CheckNameAvailabilityRequest, - CheckNameAvailabilityPostOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json - */ -async function exampleWhenNameIsAvailableForADiagnosticResource() { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options: CheckNameAvailabilityPostOptionalParams = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.post(scope, options); - console.log(result); -} - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json - */ -async function exampleWhenNameIsNotAvailableForADiagnosticResource() { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options: CheckNameAvailabilityPostOptionalParams = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.post(scope, options); - console.log(result); -} - -async function main() { - exampleWhenNameIsAvailableForADiagnosticResource(); - exampleWhenNameIsNotAvailableForADiagnosticResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsCreateSample.ts deleted file mode 100644 index 4edcc82940af..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsCreateSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a diagnostic for the specific resource using solutionId from discovery solutions.
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.

- * - * @summary Creates a diagnostic for the specific resource using solutionId from discovery solutions.
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.

- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json - */ -async function createsADiagnosticForAKeyVaultResource() { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.beginCreateAndWait( - scope, - diagnosticsResourceName, - ); - console.log(result); -} - -async function main() { - createsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsGetSample.ts deleted file mode 100644 index 07cdbaf67a34..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * - * @summary Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json - */ -async function getsADiagnosticForAKeyVaultResource() { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.get(scope, diagnosticsResourceName); - console.log(result); -} - -async function main() { - getsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionListSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionListSample.ts deleted file mode 100644 index 995838191872..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionListSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DiscoverySolutionListOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * - * @summary Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json - */ -async function listDiscoverySolutionsAtResourceScope() { - const filter = "ProblemClassificationId eq 'SampleProblemClassificationId1'"; - const options: DiscoverySolutionListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const resArray = new Array(); - for await (let item of client.discoverySolution.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDiscoverySolutionsAtResourceScope(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.ts deleted file mode 100644 index c7d32debd129..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DiscoveryNlpRequest, - DiscoverySolutionNLPSubscriptionScopePostOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || - "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const discoverSolutionRequest: DiscoveryNlpRequest = { - issueSummary: "how to retrieve certs from deleted keyvault.", - resourceId: - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", - serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", - }; - const options: DiscoverySolutionNLPSubscriptionScopePostOptionalParams = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); - const result = - await client.discoverySolutionNLPSubscriptionScope.post(options); - console.log(result); -} - -async function main() { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpTenantScopePostSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpTenantScopePostSample.ts deleted file mode 100644 index 814c0dd868dd..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpTenantScopePostSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DiscoveryNlpRequest, - DiscoverySolutionNLPTenantScopePostOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const discoverSolutionRequest: DiscoveryNlpRequest = { - issueSummary: "how to retrieve certs from deleted keyvault.", - resourceId: - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", - serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", - }; - const options: DiscoverySolutionNLPTenantScopePostOptionalParams = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.discoverySolutionNLPTenantScope.post(options); - console.log(result); -} - -async function main() { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts deleted file mode 100644 index 9e8ff943912b..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns list of operations. - * - * @summary Returns list of operations. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json - */ -async function listAllOperations() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllOperations(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsCreateSample.ts deleted file mode 100644 index 155dbb842c9a..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsCreateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SimplifiedSolutionsResource, - SimplifiedSolutionsCreateOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * - * @summary Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json - */ -async function solutionCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const simplifiedSolutionsRequestBody: SimplifiedSolutionsResource = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "sampleSolutionId", - }; - const options: SimplifiedSolutionsCreateOptionalParams = { - simplifiedSolutionsRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.beginCreateAndWait( - scope, - simplifiedSolutionsResourceName, - options, - ); - console.log(result); -} - -async function main() { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsGetSample.ts deleted file mode 100644 index 912d1c736e03..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * - * @summary Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json - */ -async function solutionGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.get( - scope, - simplifiedSolutionsResourceName, - ); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionCreateSample.ts deleted file mode 100644 index d24469067ea7..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SolutionResource, - SolutionCreateOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
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.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * - * @summary Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
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.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json - */ -async function solutionCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const solutionRequestBody: SolutionResource = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - triggerCriteria: [{ name: "SolutionId", value: "SolutionId1" }], - }; - const options: SolutionCreateOptionalParams = { solutionRequestBody }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginCreateAndWait( - scope, - solutionResourceName, - options, - ); - console.log(result); -} - -async function main() { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionGetSample.ts deleted file mode 100644 index d88ca24e304c..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the solution using the applicable solutionResourceName while creating the solution. - * - * @summary Get the solution using the applicable solutionResourceName while creating the solution. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json - */ -async function solutionGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResource1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.get(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionSelfHelpGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionSelfHelpGetSample.ts deleted file mode 100644 index 7259b96b32e1..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionSelfHelpGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * - * @summary Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json - */ -async function solutionGet() { - const solutionId = "SolutionId1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solutionSelfHelp.get(solutionId); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionUpdateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionUpdateSample.ts deleted file mode 100644 index b54f806b1e06..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionUpdateSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update the requiredInputs or additional information needed to execute the solution - * - * @summary Update the requiredInputs or additional information needed to execute the solution - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json - */ -async function solutionUpdate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginUpdateAndWait( - scope, - solutionResourceName, - ); - console.log(result); -} - -async function main() { - solutionUpdate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionWarmUpSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionWarmUpSample.ts deleted file mode 100644 index 3e7d7cdb5a54..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionWarmUpSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Warm up the solution resource by preloading asynchronous diagnostics results into cache - * - * @summary Warm up the solution resource by preloading asynchronous diagnostics results into cache - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json - */ -async function solutionWarmUp() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.warmUp(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionWarmUp(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersContinueSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersContinueSample.ts deleted file mode 100644 index 1258b13d9a66..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersContinueSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ContinueRequestBody, - TroubleshootersContinueOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
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. - * - * @summary Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
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. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json - */ -async function troubleshooterContinue() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const continueRequestBody: ContinueRequestBody = { - stepId: "SampleStepId", - responses: [ - { - questionId: "SampleQuestionId", - questionType: "Text", - response: "Connection exception", - }, - ], - }; - const options: TroubleshootersContinueOptionalParams = { - continueRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.continue( - scope, - troubleshooterName, - options, - ); - console.log(result); -} - -async function main() { - troubleshooterContinue(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersCreateSample.ts deleted file mode 100644 index 9bd6c0c95936..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersCreateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TroubleshooterResource, - TroubleshootersCreateOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
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. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * - * @summary Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
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. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json - */ -async function troubleshootersCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const createTroubleshooterRequestBody: TroubleshooterResource = { - parameters: { - resourceURI: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "SampleTroubleshooterSolutionId", - }; - const options: TroubleshootersCreateOptionalParams = { - createTroubleshooterRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.create( - scope, - troubleshooterName, - options, - ); - console.log(result); -} - -async function main() { - troubleshootersCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersEndSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersEndSample.ts deleted file mode 100644 index 10925ff92d20..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersEndSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Ends the troubleshooter action - * - * @summary Ends the troubleshooter action - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json - */ -async function troubleshootersEnd() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.end(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersEnd(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersGetSample.ts deleted file mode 100644 index accc939fdc4b..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
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. - * - * @summary Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
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. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json - */ -async function troubleshootersGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.get(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersRestartSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersRestartSample.ts deleted file mode 100644 index 3e842b727db6..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersRestartSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * - * @summary Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json - */ -async function troubleshootersRestart() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.restart( - scope, - troubleshooterName, - ); - console.log(result); -} - -async function main() { - troubleshootersRestart(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/README.md b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/README.md deleted file mode 100644 index 118c84229bf5..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [checkNameAvailabilityPostSample.js][checknameavailabilitypostsample] | This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json | -| [diagnosticsCreateSample.js][diagnosticscreatesample] | Creates a diagnostic for the specific resource using solutionId from discovery solutions.
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.

x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json | -| [diagnosticsGetSample.js][diagnosticsgetsample] | Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json | -| [discoverySolutionListSample.js][discoverysolutionlistsample] | Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json | -| [discoverySolutionNlpSubscriptionScopePostSample.js][discoverysolutionnlpsubscriptionscopepostsample] | Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json | -| [discoverySolutionNlpTenantScopePostSample.js][discoverysolutionnlptenantscopepostsample] | Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json | -| [operationsListSample.js][operationslistsample] | Returns list of operations. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json | -| [simplifiedSolutionsCreateSample.js][simplifiedsolutionscreatesample] | Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json | -| [simplifiedSolutionsGetSample.js][simplifiedsolutionsgetsample] | Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json | -| [solutionCreateSample.js][solutioncreatesample] | Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
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.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json | -| [solutionGetSample.js][solutiongetsample] | Get the solution using the applicable solutionResourceName while creating the solution. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json | -| [solutionSelfHelpGetSample.js][solutionselfhelpgetsample] | Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json | -| [solutionUpdateSample.js][solutionupdatesample] | Update the requiredInputs or additional information needed to execute the solution x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json | -| [solutionWarmUpSample.js][solutionwarmupsample] | Warm up the solution resource by preloading asynchronous diagnostics results into cache x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json | -| [troubleshootersContinueSample.js][troubleshooterscontinuesample] | Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
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. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json | -| [troubleshootersCreateSample.js][troubleshooterscreatesample] | Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
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. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json | -| [troubleshootersEndSample.js][troubleshootersendsample] | Ends the troubleshooter action x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json | -| [troubleshootersGetSample.js][troubleshootersgetsample] | Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
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. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json | -| [troubleshootersRestartSample.js][troubleshootersrestartsample] | Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node checkNameAvailabilityPostSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node checkNameAvailabilityPostSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[checknameavailabilitypostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/checkNameAvailabilityPostSample.js -[diagnosticscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsCreateSample.js -[diagnosticsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsGetSample.js -[discoverysolutionlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionListSample.js -[discoverysolutionnlpsubscriptionscopepostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpSubscriptionScopePostSample.js -[discoverysolutionnlptenantscopepostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpTenantScopePostSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js -[simplifiedsolutionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsCreateSample.js -[simplifiedsolutionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsGetSample.js -[solutioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionCreateSample.js -[solutiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionGetSample.js -[solutionselfhelpgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionSelfHelpGetSample.js -[solutionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionUpdateSample.js -[solutionwarmupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionWarmUpSample.js -[troubleshooterscontinuesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersContinueSample.js -[troubleshooterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersCreateSample.js -[troubleshootersendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersEndSample.js -[troubleshootersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersGetSample.js -[troubleshootersrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersRestartSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-selfhelp?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp/README.md diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/checkNameAvailabilityPostSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/checkNameAvailabilityPostSample.js deleted file mode 100644 index 5d786deda45d..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/checkNameAvailabilityPostSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json - */ -async function exampleWhenNameIsAvailableForADiagnosticResource() { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.post(scope, options); - console.log(result); -} - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json - */ -async function exampleWhenNameIsNotAvailableForADiagnosticResource() { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.post(scope, options); - console.log(result); -} - -async function main() { - exampleWhenNameIsAvailableForADiagnosticResource(); - exampleWhenNameIsNotAvailableForADiagnosticResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsCreateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsCreateSample.js deleted file mode 100644 index 748de90b45df..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsCreateSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a diagnostic for the specific resource using solutionId from discovery solutions.
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.

- * - * @summary Creates a diagnostic for the specific resource using solutionId from discovery solutions.
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.

- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json - */ -async function createsADiagnosticForAKeyVaultResource() { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.beginCreateAndWait(scope, diagnosticsResourceName); - console.log(result); -} - -async function main() { - createsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsGetSample.js deleted file mode 100644 index d2fb71b875e3..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * - * @summary Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json - */ -async function getsADiagnosticForAKeyVaultResource() { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.get(scope, diagnosticsResourceName); - console.log(result); -} - -async function main() { - getsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionListSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionListSample.js deleted file mode 100644 index 26fca18443f5..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * - * @summary Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json - */ -async function listDiscoverySolutionsAtResourceScope() { - const filter = "ProblemClassificationId eq 'SampleProblemClassificationId1'"; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const resArray = new Array(); - for await (let item of client.discoverySolution.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDiscoverySolutionsAtResourceScope(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpSubscriptionScopePostSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpSubscriptionScopePostSample.js deleted file mode 100644 index 8d5bf2bb3d5a..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpSubscriptionScopePostSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const discoverSolutionRequest = { - issueSummary: "how to retrieve certs from deleted keyvault.", - resourceId: - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", - serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", - }; - const options = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); - const result = await client.discoverySolutionNLPSubscriptionScope.post(options); - console.log(result); -} - -async function main() { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpTenantScopePostSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpTenantScopePostSample.js deleted file mode 100644 index a99209417f40..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpTenantScopePostSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const discoverSolutionRequest = { - issueSummary: "how to retrieve certs from deleted keyvault.", - resourceId: - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", - serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", - }; - const options = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.discoverySolutionNLPTenantScope.post(options); - console.log(result); -} - -async function main() { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js deleted file mode 100644 index a259555e1d9f..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns list of operations. - * - * @summary Returns list of operations. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json - */ -async function listAllOperations() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllOperations(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/package.json b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/package.json deleted file mode 100644 index e9f4e249ab7a..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-selfhelp-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/selfhelp/arm-selfhelp" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp", - "dependencies": { - "@azure/arm-selfhelp": "next", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - } -} diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/sample.env b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsCreateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsCreateSample.js deleted file mode 100644 index 6d1a23796fd4..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsCreateSample.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * - * @summary Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json - */ -async function solutionCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const simplifiedSolutionsRequestBody = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "sampleSolutionId", - }; - const options = { - simplifiedSolutionsRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.beginCreateAndWait( - scope, - simplifiedSolutionsResourceName, - options, - ); - console.log(result); -} - -async function main() { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsGetSample.js deleted file mode 100644 index af14dad740e1..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * - * @summary Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json - */ -async function solutionGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.get(scope, simplifiedSolutionsResourceName); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionCreateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionCreateSample.js deleted file mode 100644 index 85f661a9b342..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionCreateSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
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.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * - * @summary Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
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.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json - */ -async function solutionCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const solutionRequestBody = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - triggerCriteria: [{ name: "SolutionId", value: "SolutionId1" }], - }; - const options = { solutionRequestBody }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginCreateAndWait(scope, solutionResourceName, options); - console.log(result); -} - -async function main() { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionGetSample.js deleted file mode 100644 index ae2116f6c09e..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the solution using the applicable solutionResourceName while creating the solution. - * - * @summary Get the solution using the applicable solutionResourceName while creating the solution. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json - */ -async function solutionGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResource1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.get(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionSelfHelpGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionSelfHelpGetSample.js deleted file mode 100644 index cd356f786d7f..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionSelfHelpGetSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * - * @summary Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json - */ -async function solutionGet() { - const solutionId = "SolutionId1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solutionSelfHelp.get(solutionId); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionUpdateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionUpdateSample.js deleted file mode 100644 index 459bc7224289..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionUpdateSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update the requiredInputs or additional information needed to execute the solution - * - * @summary Update the requiredInputs or additional information needed to execute the solution - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json - */ -async function solutionUpdate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginUpdateAndWait(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionUpdate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionWarmUpSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionWarmUpSample.js deleted file mode 100644 index f5ece4a45041..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionWarmUpSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Warm up the solution resource by preloading asynchronous diagnostics results into cache - * - * @summary Warm up the solution resource by preloading asynchronous diagnostics results into cache - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json - */ -async function solutionWarmUp() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.warmUp(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionWarmUp(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersContinueSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersContinueSample.js deleted file mode 100644 index eda841f20f50..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersContinueSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
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. - * - * @summary Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
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. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json - */ -async function troubleshooterContinue() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const continueRequestBody = { - stepId: "SampleStepId", - responses: [ - { - questionId: "SampleQuestionId", - questionType: "Text", - response: "Connection exception", - }, - ], - }; - const options = { - continueRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.continue(scope, troubleshooterName, options); - console.log(result); -} - -async function main() { - troubleshooterContinue(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersCreateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersCreateSample.js deleted file mode 100644 index 3c8ae61f530e..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersCreateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
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. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * - * @summary Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
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. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json - */ -async function troubleshootersCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const createTroubleshooterRequestBody = { - parameters: { - resourceURI: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "SampleTroubleshooterSolutionId", - }; - const options = { - createTroubleshooterRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.create(scope, troubleshooterName, options); - console.log(result); -} - -async function main() { - troubleshootersCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersEndSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersEndSample.js deleted file mode 100644 index 014c22874594..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersEndSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Ends the troubleshooter action - * - * @summary Ends the troubleshooter action - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json - */ -async function troubleshootersEnd() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.end(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersEnd(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersGetSample.js deleted file mode 100644 index e22dbbb6cee4..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
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. - * - * @summary Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
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. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json - */ -async function troubleshootersGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.get(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersRestartSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersRestartSample.js deleted file mode 100644 index 95956ee83d13..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersRestartSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * - * @summary Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json - */ -async function troubleshootersRestart() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.restart(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersRestart(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/README.md b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/README.md deleted file mode 100644 index ccc3236c2d2f..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [checkNameAvailabilityPostSample.ts][checknameavailabilitypostsample] | This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json | -| [diagnosticsCreateSample.ts][diagnosticscreatesample] | Creates a diagnostic for the specific resource using solutionId from discovery solutions.
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.

x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json | -| [diagnosticsGetSample.ts][diagnosticsgetsample] | Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json | -| [discoverySolutionListSample.ts][discoverysolutionlistsample] | Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json | -| [discoverySolutionNlpSubscriptionScopePostSample.ts][discoverysolutionnlpsubscriptionscopepostsample] | Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json | -| [discoverySolutionNlpTenantScopePostSample.ts][discoverysolutionnlptenantscopepostsample] | Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json | -| [operationsListSample.ts][operationslistsample] | Returns list of operations. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json | -| [simplifiedSolutionsCreateSample.ts][simplifiedsolutionscreatesample] | Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json | -| [simplifiedSolutionsGetSample.ts][simplifiedsolutionsgetsample] | Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json | -| [solutionCreateSample.ts][solutioncreatesample] | Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
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.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json | -| [solutionGetSample.ts][solutiongetsample] | Get the solution using the applicable solutionResourceName while creating the solution. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json | -| [solutionSelfHelpGetSample.ts][solutionselfhelpgetsample] | Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json | -| [solutionUpdateSample.ts][solutionupdatesample] | Update the requiredInputs or additional information needed to execute the solution x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json | -| [solutionWarmUpSample.ts][solutionwarmupsample] | Warm up the solution resource by preloading asynchronous diagnostics results into cache x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json | -| [troubleshootersContinueSample.ts][troubleshooterscontinuesample] | Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
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. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json | -| [troubleshootersCreateSample.ts][troubleshooterscreatesample] | Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
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. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json | -| [troubleshootersEndSample.ts][troubleshootersendsample] | Ends the troubleshooter action x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json | -| [troubleshootersGetSample.ts][troubleshootersgetsample] | Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
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. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json | -| [troubleshootersRestartSample.ts][troubleshootersrestartsample] | Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/checkNameAvailabilityPostSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node dist/checkNameAvailabilityPostSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[checknameavailabilitypostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/checkNameAvailabilityPostSample.ts -[diagnosticscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsCreateSample.ts -[diagnosticsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsGetSample.ts -[discoverysolutionlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionListSample.ts -[discoverysolutionnlpsubscriptionscopepostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpSubscriptionScopePostSample.ts -[discoverysolutionnlptenantscopepostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpTenantScopePostSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts -[simplifiedsolutionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsCreateSample.ts -[simplifiedsolutionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsGetSample.ts -[solutioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionCreateSample.ts -[solutiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionGetSample.ts -[solutionselfhelpgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionSelfHelpGetSample.ts -[solutionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionUpdateSample.ts -[solutionwarmupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionWarmUpSample.ts -[troubleshooterscontinuesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersContinueSample.ts -[troubleshooterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersCreateSample.ts -[troubleshootersendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersEndSample.ts -[troubleshootersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersGetSample.ts -[troubleshootersrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersRestartSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-selfhelp?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/package.json b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/package.json deleted file mode 100644 index 5012d84b6eff..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-selfhelp-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/selfhelp/arm-selfhelp" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp", - "dependencies": { - "@azure/arm-selfhelp": "next", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.4.5", - "rimraf": "latest" - } -} diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/sample.env b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/checkNameAvailabilityPostSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/checkNameAvailabilityPostSample.ts deleted file mode 100644 index 2c3f8b060b08..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/checkNameAvailabilityPostSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CheckNameAvailabilityRequest, - CheckNameAvailabilityPostOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json - */ -async function exampleWhenNameIsAvailableForADiagnosticResource() { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options: CheckNameAvailabilityPostOptionalParams = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.post(scope, options); - console.log(result); -} - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json - */ -async function exampleWhenNameIsNotAvailableForADiagnosticResource() { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options: CheckNameAvailabilityPostOptionalParams = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.post(scope, options); - console.log(result); -} - -async function main() { - exampleWhenNameIsAvailableForADiagnosticResource(); - exampleWhenNameIsNotAvailableForADiagnosticResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsCreateSample.ts deleted file mode 100644 index 4edcc82940af..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsCreateSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a diagnostic for the specific resource using solutionId from discovery solutions.
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.

- * - * @summary Creates a diagnostic for the specific resource using solutionId from discovery solutions.
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.

- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json - */ -async function createsADiagnosticForAKeyVaultResource() { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.beginCreateAndWait( - scope, - diagnosticsResourceName, - ); - console.log(result); -} - -async function main() { - createsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsGetSample.ts deleted file mode 100644 index 07cdbaf67a34..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * - * @summary Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json - */ -async function getsADiagnosticForAKeyVaultResource() { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.get(scope, diagnosticsResourceName); - console.log(result); -} - -async function main() { - getsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionListSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionListSample.ts deleted file mode 100644 index 995838191872..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionListSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DiscoverySolutionListOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * - * @summary Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json - */ -async function listDiscoverySolutionsAtResourceScope() { - const filter = "ProblemClassificationId eq 'SampleProblemClassificationId1'"; - const options: DiscoverySolutionListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const resArray = new Array(); - for await (let item of client.discoverySolution.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDiscoverySolutionsAtResourceScope(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpSubscriptionScopePostSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpSubscriptionScopePostSample.ts deleted file mode 100644 index c7d32debd129..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpSubscriptionScopePostSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DiscoveryNlpRequest, - DiscoverySolutionNLPSubscriptionScopePostOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || - "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const discoverSolutionRequest: DiscoveryNlpRequest = { - issueSummary: "how to retrieve certs from deleted keyvault.", - resourceId: - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", - serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", - }; - const options: DiscoverySolutionNLPSubscriptionScopePostOptionalParams = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); - const result = - await client.discoverySolutionNLPSubscriptionScope.post(options); - console.log(result); -} - -async function main() { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpTenantScopePostSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpTenantScopePostSample.ts deleted file mode 100644 index 814c0dd868dd..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpTenantScopePostSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DiscoveryNlpRequest, - DiscoverySolutionNLPTenantScopePostOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const discoverSolutionRequest: DiscoveryNlpRequest = { - issueSummary: "how to retrieve certs from deleted keyvault.", - resourceId: - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", - serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", - }; - const options: DiscoverySolutionNLPTenantScopePostOptionalParams = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.discoverySolutionNLPTenantScope.post(options); - console.log(result); -} - -async function main() { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts deleted file mode 100644 index 9e8ff943912b..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns list of operations. - * - * @summary Returns list of operations. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json - */ -async function listAllOperations() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllOperations(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsCreateSample.ts deleted file mode 100644 index 155dbb842c9a..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsCreateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SimplifiedSolutionsResource, - SimplifiedSolutionsCreateOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * - * @summary Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json - */ -async function solutionCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const simplifiedSolutionsRequestBody: SimplifiedSolutionsResource = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "sampleSolutionId", - }; - const options: SimplifiedSolutionsCreateOptionalParams = { - simplifiedSolutionsRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.beginCreateAndWait( - scope, - simplifiedSolutionsResourceName, - options, - ); - console.log(result); -} - -async function main() { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsGetSample.ts deleted file mode 100644 index 912d1c736e03..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * - * @summary Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json - */ -async function solutionGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.get( - scope, - simplifiedSolutionsResourceName, - ); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionCreateSample.ts deleted file mode 100644 index d24469067ea7..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SolutionResource, - SolutionCreateOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
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.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * - * @summary Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
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.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json - */ -async function solutionCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const solutionRequestBody: SolutionResource = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - triggerCriteria: [{ name: "SolutionId", value: "SolutionId1" }], - }; - const options: SolutionCreateOptionalParams = { solutionRequestBody }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginCreateAndWait( - scope, - solutionResourceName, - options, - ); - console.log(result); -} - -async function main() { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionGetSample.ts deleted file mode 100644 index d88ca24e304c..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the solution using the applicable solutionResourceName while creating the solution. - * - * @summary Get the solution using the applicable solutionResourceName while creating the solution. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json - */ -async function solutionGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResource1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.get(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionSelfHelpGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionSelfHelpGetSample.ts deleted file mode 100644 index 7259b96b32e1..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionSelfHelpGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * - * @summary Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json - */ -async function solutionGet() { - const solutionId = "SolutionId1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solutionSelfHelp.get(solutionId); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionUpdateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionUpdateSample.ts deleted file mode 100644 index b54f806b1e06..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionUpdateSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update the requiredInputs or additional information needed to execute the solution - * - * @summary Update the requiredInputs or additional information needed to execute the solution - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json - */ -async function solutionUpdate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginUpdateAndWait( - scope, - solutionResourceName, - ); - console.log(result); -} - -async function main() { - solutionUpdate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionWarmUpSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionWarmUpSample.ts deleted file mode 100644 index 3e7d7cdb5a54..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionWarmUpSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Warm up the solution resource by preloading asynchronous diagnostics results into cache - * - * @summary Warm up the solution resource by preloading asynchronous diagnostics results into cache - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json - */ -async function solutionWarmUp() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.warmUp(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionWarmUp(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersContinueSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersContinueSample.ts deleted file mode 100644 index 1258b13d9a66..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersContinueSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ContinueRequestBody, - TroubleshootersContinueOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
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. - * - * @summary Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
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. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json - */ -async function troubleshooterContinue() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const continueRequestBody: ContinueRequestBody = { - stepId: "SampleStepId", - responses: [ - { - questionId: "SampleQuestionId", - questionType: "Text", - response: "Connection exception", - }, - ], - }; - const options: TroubleshootersContinueOptionalParams = { - continueRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.continue( - scope, - troubleshooterName, - options, - ); - console.log(result); -} - -async function main() { - troubleshooterContinue(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersCreateSample.ts deleted file mode 100644 index 9bd6c0c95936..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersCreateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TroubleshooterResource, - TroubleshootersCreateOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
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. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * - * @summary Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
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. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json - */ -async function troubleshootersCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const createTroubleshooterRequestBody: TroubleshooterResource = { - parameters: { - resourceURI: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "SampleTroubleshooterSolutionId", - }; - const options: TroubleshootersCreateOptionalParams = { - createTroubleshooterRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.create( - scope, - troubleshooterName, - options, - ); - console.log(result); -} - -async function main() { - troubleshootersCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersEndSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersEndSample.ts deleted file mode 100644 index 10925ff92d20..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersEndSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Ends the troubleshooter action - * - * @summary Ends the troubleshooter action - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json - */ -async function troubleshootersEnd() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.end(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersEnd(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersGetSample.ts deleted file mode 100644 index accc939fdc4b..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
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. - * - * @summary Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
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. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json - */ -async function troubleshootersGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.get(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersRestartSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersRestartSample.ts deleted file mode 100644 index 3e842b727db6..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersRestartSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * - * @summary Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json - */ -async function troubleshootersRestart() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.restart( - scope, - troubleshooterName, - ); - console.log(result); -} - -async function main() { - troubleshootersRestart(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/tsconfig.json b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/selfhelp/arm-selfhelp/src/helpRP.ts b/sdk/selfhelp/arm-selfhelp/src/helpRP.ts index 01895c2b192b..fe8136657848 100644 --- a/sdk/selfhelp/arm-selfhelp/src/helpRP.ts +++ b/sdk/selfhelp/arm-selfhelp/src/helpRP.ts @@ -43,40 +43,20 @@ import { HelpRPOptionalParams } from "./models"; export class HelpRP extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId?: string; /** * Initializes a new instance of the HelpRP class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, - subscriptionId: string, - options?: HelpRPOptionalParams, - ); - constructor( - credentials: coreAuth.TokenCredential, - options?: HelpRPOptionalParams, - ); - constructor( - credentials: coreAuth.TokenCredential, - subscriptionIdOrOptions?: HelpRPOptionalParams | string, options?: HelpRPOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - let subscriptionId: string | undefined; - - if (typeof subscriptionIdOrOptions === "string") { - subscriptionId = subscriptionIdOrOptions; - } else if (typeof subscriptionIdOrOptions === "object") { - options = subscriptionIdOrOptions; - } - // Initializing default values for options if (!options) { options = {}; @@ -135,8 +115,6 @@ export class HelpRP extends coreClient.ServiceClient { }), ); } - // Parameter assignments - this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; diff --git a/sdk/selfhelp/arm-selfhelp/src/models/index.ts b/sdk/selfhelp/arm-selfhelp/src/models/index.ts index 5f0a7c519d1a..b8d284e04a6e 100644 --- a/sdk/selfhelp/arm-selfhelp/src/models/index.ts +++ b/sdk/selfhelp/arm-selfhelp/src/models/index.ts @@ -576,7 +576,7 @@ export interface SectionSelfHelp { export interface DiscoveryNlpRequest { /** Natural language description of the issue. */ issueSummary: string; - /** ARM resource Id of the resource that is having the issue. */ + /** ARM resource Id of the resource that is having the issue. Only applicable for Discovery Solution NLP Subscription Scope. */ resourceId?: string; /** ARM service Id of the service that is having the issue. For more information on service Id see https://learn.microsoft.com/rest/api/support/services/list?tabs=HTTP. */ serviceId?: string; diff --git a/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts b/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts index ef784e4bbf6e..50a5268376bc 100644 --- a/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts +++ b/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts @@ -246,7 +246,8 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "Uuid", + name: "String", }, }, + skipEncoding: true, }; diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLPSubscriptionScope.ts b/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLPSubscriptionScope.ts index c56e9cdaaed0..c1a8e31af060 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLPSubscriptionScope.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLPSubscriptionScope.ts @@ -33,12 +33,17 @@ export class DiscoverySolutionNLPSubscriptionScopeImpl /** * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue * summary and subscription. + * @param subscriptionId The Azure subscription ID. * @param options The options parameters. */ post( + subscriptionId: string, options?: DiscoverySolutionNLPSubscriptionScopePostOptionalParams, ): Promise { - return this.client.sendOperationRequest({ options }, postOperationSpec); + return this.client.sendOperationRequest( + { subscriptionId, options }, + postOperationSpec, + ); } } // Operation Specifications diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.ts index bf1b101f3ab1..15d315584f9a 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.ts @@ -16,9 +16,11 @@ export interface DiscoverySolutionNLPSubscriptionScope { /** * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue * summary and subscription. + * @param subscriptionId The Azure subscription ID. * @param options The options parameters. */ post( + subscriptionId: string, options?: DiscoverySolutionNLPSubscriptionScopePostOptionalParams, ): Promise; } diff --git a/sdk/selfhelp/arm-selfhelp/test/sampleTest.ts b/sdk/selfhelp/arm-selfhelp/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/selfhelp/arm-selfhelp/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env, +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts b/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts deleted file mode 100644 index f1d2ac659a4b..000000000000 --- a/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { HelpRP } from "../src/helpRP"; - -const replaceableVariables: Record = { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe.skip("help test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: HelpRP; - let location: string; - let resourceGroup: string; - let resourcename: string; - let scope: string; - let scope1: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new HelpRP(credential, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "czwjstest"; - resourcename = "resourcetest1"; - scope = "subscriptions/" + subscriptionId; - scope1 = "subscriptions/" + subscriptionId + "/resourceGroups/myjstest/providers/Microsoft.KeyVault/vaults/testkey20230703"; - }); - - afterEach(async function () { - await recorder.stop(); - }); - - // I think we could skip this case, because service don't give delete api to detele this resource - it.skip("diagnostics create test", async function () { - const options = { - diagnosticResourceRequest: { - insights: [ - { - solutionId: "KeyVaultUnauthorizedNetworkInsight" - } - ] - }, - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, - } - const result = await client.diagnostics.beginCreateAndWait( - scope1, - resourcename, - options - ); - assert.equal(result.name, resourcename); - }); - - it("selfhelp operation test", async function () { - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - assert.notEqual(resArray.length, 0) - }); - -}) diff --git a/sdk/selfhelp/arm-selfhelp/tsconfig.json b/sdk/selfhelp/arm-selfhelp/tsconfig.json index 43c53468dfed..3e6ae96443f3 100644 --- a/sdk/selfhelp/arm-selfhelp/tsconfig.json +++ b/sdk/selfhelp/arm-selfhelp/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-selfhelp": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"