Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions sdk/impactreporting/arm-impactreporting/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Release History

## 1.0.0-beta.2 (2025-08-28)
Compared with version 1.0.0-beta.1

### Features Added
- Added Interface Performance
- Interface ImpactClientOptionalParams has a new optional parameter cloudSetting
- Added Type Alias AzureSupportedClouds
- Added Enum AzureClouds

### Breaking Changes
- Removed Interface Performance_2


## 1.0.0-beta.1 (2025-02-20)

Expand Down
4 changes: 4 additions & 0 deletions sdk/impactreporting/arm-impactreporting/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"apiVersion": "2024-05-01-preview",
"emitterVersion": "0.43.0"
}
2 changes: 1 addition & 1 deletion sdk/impactreporting/arm-impactreporting/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/arm-impactreporting",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "A generated SDK for ImpactClient.",
"engines": {
"node": ">=20.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export type CreatedByType = string;

// @public
export interface ErrorAdditionalInfo {
readonly info?: Record<string, any>;
readonly info?: any;
readonly type?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ import { TokenCredential } from '@azure/core-auth';
// @public
export type ActionType = string;

// @public
export enum AzureClouds {
AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT"
}

// @public
export type AzureSupportedClouds = `${AzureClouds}`;

// @public
export interface ClientIncidentDetails {
clientIncidentId?: string;
Expand Down Expand Up @@ -103,7 +113,7 @@ export type CreatedByType = string;

// @public
export interface ErrorAdditionalInfo {
readonly info?: Record<string, any>;
readonly info?: any;
readonly type?: string;
}

Expand Down Expand Up @@ -176,6 +186,7 @@ export class ImpactClient {
// @public
export interface ImpactClientOptionalParams extends ClientOptions {
apiVersion?: string;
cloudSetting?: AzureSupportedClouds;
}

// @public
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to create a Connector
*
* @summary create a Connector
* x-ms-original-file: 2024-05-01-preview/Connectors_CreateOrUpdate.json
*/
async function connectorsCreateOrUpdate(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d";
const client = new ImpactClient(credential, subscriptionId);
const result = await client.connectors.createOrUpdate("testconnector1", {
properties: {
connectorType: "AzureMonitor",
connectorId: "",
tenantId: "",
lastRunTimeStamp: new Date(),
},
});
console.log(result);
}

async function main(): Promise<void> {
await connectorsCreateOrUpdate();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to delete a Connector
*
* @summary delete a Connector
* x-ms-original-file: 2024-05-01-preview/Connectors_Delete.json
*/
async function connectorsDelete(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "8F74B371-8573-4773-9BDA-D546505BDB3A";
const client = new ImpactClient(credential, subscriptionId);
await client.connectors.delete("testconnector1");
}

async function main(): Promise<void> {
await connectorsDelete();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to get a Connector
*
* @summary get a Connector
* x-ms-original-file: 2024-05-01-preview/Connectors_Get.json
*/
async function connectorsGet(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d";
const client = new ImpactClient(credential, subscriptionId);
const result = await client.connectors.get("testconnector1");
console.log(result);
}

async function main(): Promise<void> {
await connectorsGet();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to list Connector resources by subscription ID
*
* @summary list Connector resources by subscription ID
* x-ms-original-file: 2024-05-01-preview/Connectors_ListBySubscription.json
*/
async function connectorsListBySubscription(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d";
const client = new ImpactClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.connectors.listBySubscription()) {
resArray.push(item);
}

console.log(resArray);
}

async function main(): Promise<void> {
await connectorsListBySubscription();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to update a Connector
*
* @summary update a Connector
* x-ms-original-file: 2024-05-01-preview/Connectors_Update.json
*/
async function connectorsUpdate(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "74f5e23f-d4d9-410a-bb4d-8f0608adb10d";
const client = new ImpactClient(credential, subscriptionId);
const result = await client.connectors.update("testconnector1", {
properties: { connectorType: "AzureMonitor" },
});
console.log(result);
}

async function main(): Promise<void> {
await connectorsUpdate();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to get a ImpactCategory
*
* @summary get a ImpactCategory
* x-ms-original-file: 2024-05-01-preview/ImpactCategories_Get.json
*/
async function getWorkloadImpactResourceByName(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ImpactClient(credential, subscriptionId);
const result = await client.impactCategories.get("ARMOperation.Create");
console.log(result);
}

async function main(): Promise<void> {
await getWorkloadImpactResourceByName();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to list ImpactCategory resources by subscription
*
* @summary list ImpactCategory resources by subscription
* x-ms-original-file: 2024-05-01-preview/ImpactCategories_ListBySubscription.json
*/
async function getImpactCategoriesListBySubscription(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ImpactClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.impactCategories.listBySubscription(
"microsoft.compute/virtualmachines",
)) {
resArray.push(item);
}

console.log(resArray);
}

async function main(): Promise<void> {
await getImpactCategoriesListBySubscription();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to create Insight resource, This is Admin only operation
*
* @summary create Insight resource, This is Admin only operation
* x-ms-original-file: 2024-05-01-preview/Insights_Create.json
*/
async function creatingAnInsight(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ImpactClient(credential, subscriptionId);
const result = await client.insights.create("impactid22", "insightId12", {
properties: {
content: {
title: "Impact Has been correlated to an outage",
description:
'At 2018-11-08T00:00:00Z UTC, your services dependent on these resources <link href=”…”>VM1</link> may have experienced an issue. <br/><div>We have identified an outage that affected these resources(s). You can look at outage information on <link href="https:// portal.azure.com/#view/Microsoft_Azure_Health/AzureHealthBrowseBlade/~/serviceIssues/trackingId/NL2W-VCZ">NL2W-VCZ</link> link.<div>',
},
category: "repair",
status: "resolved",
eventTime: new Date("2023-06-15T04:00:00.009223Z"),
insightUniqueId: "00000000-0000-0000-0000-000000000000",
impact: {
impactedResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-rg/providers/Microsoft.Sql/sqlserver/dbservername",
startTime: new Date("2023-06-15T01:00:00.009223Z"),
impactId:
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.Impact/workloadImpacts/impactid22",
},
},
});
console.log(result);
}

async function main(): Promise<void> {
await creatingAnInsight();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to delete Insight resource, This is Admin only operation
*
* @summary delete Insight resource, This is Admin only operation
* x-ms-original-file: 2024-05-01-preview/Insights_Delete.json
*/
async function deleteAnInsight(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ImpactClient(credential, subscriptionId);
await client.insights.delete("impactid22", "insightId12");
}

async function main(): Promise<void> {
await deleteAnInsight();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ImpactClient } from "@azure/arm-impactreporting";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to get Insight resources by workloadImpactName and insightName
*
* @summary get Insight resources by workloadImpactName and insightName
* x-ms-original-file: 2024-05-01-preview/Insights_Get_diagnostics.json
*/
async function getInsightSampleForDiagnosticsCategory(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ImpactClient(credential, subscriptionId);
const result = await client.insights.get("impactid", "insight1");
console.log(result);
}

/**
* This sample demonstrates how to get Insight resources by workloadImpactName and insightName
*
* @summary get Insight resources by workloadImpactName and insightName
* x-ms-original-file: 2024-05-01-preview/Insights_Get_mitigationAction.json
*/
async function getInsightSampleForMitigationActionCategory(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ImpactClient(credential, subscriptionId);
const result = await client.insights.get("impactId", "HPCUASucceeded");
console.log(result);
}

/**
* This sample demonstrates how to get Insight resources by workloadImpactName and insightName
*
* @summary get Insight resources by workloadImpactName and insightName
* x-ms-original-file: 2024-05-01-preview/Insights_Get_servicehealth.json
*/
async function getInsightSampleForServiceHealthCategory(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ImpactClient(credential, subscriptionId);
const result = await client.insights.get("impactid", "insightname");
console.log(result);
}

async function main(): Promise<void> {
await getInsightSampleForDiagnosticsCategory();
await getInsightSampleForMitigationActionCategory();
await getInsightSampleForServiceHealthCategory();
}

main().catch(console.error);
Loading