Skip to content

Commit

Permalink
issue fix (Azure#26379)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazrael2119 authored Jul 5, 2023
1 parent 775ebff commit f725fd6
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sdk/selfhelp/arm-selfhelp/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/selfhelp/arm-selfhelp",
"Tag": "js/selfhelp/arm-selfhelp_05d2b1877d"
"Tag": "js/selfhelp/arm-selfhelp_4ad1653c50"
}
12 changes: 11 additions & 1 deletion sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsCreateSample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@ async function createsADiagnosticForAKeyVaultResource() {
const diagnosticsResourceName = "VMNotWorkingInsight";
const credential = new DefaultAzureCredential();
const client = new HelpRP(credential);
const options = {
diagnosticResourceRequest: {
insights: [
{
solutionId: "KeyVaultUnauthorizedNetworkInsight"
}
]
}
}
const result = await client.diagnostics.beginCreateAndWait(
scope,
diagnosticsResourceName
diagnosticsResourceName,
options
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@ async function createsADiagnosticForAKeyVaultResource() {
const diagnosticsResourceName = "VMNotWorkingInsight";
const credential = new DefaultAzureCredential();
const client = new HelpRP(credential);
const result = await client.diagnostics.beginCreateAndWait(scope, diagnosticsResourceName);
const options = {
diagnosticResourceRequest: {
insights: [
{
solutionId: "KeyVaultUnauthorizedNetworkInsight",
},
],
},
};
const result = await client.diagnostics.beginCreateAndWait(
scope,
diagnosticsResourceName,
options
);
console.log(result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@ async function createsADiagnosticForAKeyVaultResource() {
const diagnosticsResourceName = "VMNotWorkingInsight";
const credential = new DefaultAzureCredential();
const client = new HelpRP(credential);
const options = {
diagnosticResourceRequest: {
insights: [
{
solutionId: "KeyVaultUnauthorizedNetworkInsight"
}
]
}
}
const result = await client.diagnostics.beginCreateAndWait(
scope,
diagnosticsResourceName
diagnosticsResourceName,
options
);
console.log(result);
}
Expand Down
22 changes: 21 additions & 1 deletion sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe("help test", () => {
let resourceGroup: string;
let resourcename: string;
let scope: string;
let scope1: string;

beforeEach(async function (this: Context) {
recorder = new Recorder(this.currentTest);
Expand All @@ -51,8 +52,9 @@ describe("help test", () => {
client = new HelpRP(credential, recorder.configureClientOptions({}));
location = "eastus";
resourceGroup = "czwjstest";
resourcename = "resourcetest";
resourcename = "resourcetest1";
scope = "subscriptions/" + subscriptionId;
scope1 = "subscriptions/" + subscriptionId + "/resourceGroups/myjstest/providers/Microsoft.KeyVault/vaults/testkey20230703";
});

afterEach(async function () {
Expand All @@ -71,6 +73,24 @@ describe("help test", () => {
});
});

it("diagnostics create test", async function () {
const options = {
diagnosticResourceRequest: {
insights: [
{
solutionId: "KeyVaultUnauthorizedNetworkInsight"
}
]
}
}
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()) {
Expand Down

0 comments on commit f725fd6

Please sign in to comment.