@azure/arm-resourcehealth 3.2.1-alpha.20230522.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +111 -8
- package/dist/index.js +2621 -386
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.js +1 -1
- package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.js +3 -3
- package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.js +3 -3
- package/dist-esm/samples-dev/availabilityStatusesListSample.js +3 -3
- package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.js +4 -4
- package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.js.map +1 -1
- package/dist-esm/samples-dev/childAvailabilityStatusesListSample.js +4 -4
- package/dist-esm/samples-dev/childAvailabilityStatusesListSample.js.map +1 -1
- package/dist-esm/samples-dev/childResourcesListSample.js +3 -3
- package/dist-esm/samples-dev/childResourcesListSample.js.map +1 -1
- package/dist-esm/samples-dev/emergingIssuesGetSample.js +3 -2
- package/dist-esm/samples-dev/emergingIssuesGetSample.js.map +1 -1
- package/dist-esm/samples-dev/emergingIssuesListSample.js +1 -1
- package/dist-esm/samples-dev/eventFetchDetailsBySubscriptionIdAndTrackingIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/eventFetchDetailsBySubscriptionIdAndTrackingIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/eventFetchDetailsBySubscriptionIdAndTrackingIdSample.js +37 -0
- package/dist-esm/samples-dev/eventFetchDetailsBySubscriptionIdAndTrackingIdSample.js.map +1 -0
- package/dist-esm/samples-dev/eventFetchDetailsByTenantIdAndTrackingIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/eventFetchDetailsByTenantIdAndTrackingIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/eventFetchDetailsByTenantIdAndTrackingIdSample.js +38 -0
- package/dist-esm/samples-dev/eventFetchDetailsByTenantIdAndTrackingIdSample.js.map +1 -0
- package/dist-esm/samples-dev/eventGetBySubscriptionIdAndTrackingIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/eventGetBySubscriptionIdAndTrackingIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/eventGetBySubscriptionIdAndTrackingIdSample.js +43 -0
- package/dist-esm/samples-dev/eventGetBySubscriptionIdAndTrackingIdSample.js.map +1 -0
- package/dist-esm/samples-dev/eventGetByTenantIdAndTrackingIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/eventGetByTenantIdAndTrackingIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/eventGetByTenantIdAndTrackingIdSample.js +44 -0
- package/dist-esm/samples-dev/eventGetByTenantIdAndTrackingIdSample.js.map +1 -0
- package/dist-esm/samples-dev/eventsListBySingleResourceSample.d.ts +2 -0
- package/dist-esm/samples-dev/eventsListBySingleResourceSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/eventsListBySingleResourceSample.js +59 -0
- package/dist-esm/samples-dev/eventsListBySingleResourceSample.js.map +1 -0
- package/dist-esm/samples-dev/eventsListBySubscriptionIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/eventsListBySubscriptionIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/eventsListBySubscriptionIdSample.js +63 -0
- package/dist-esm/samples-dev/eventsListBySubscriptionIdSample.js.map +1 -0
- package/dist-esm/samples-dev/eventsListByTenantIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/eventsListByTenantIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/eventsListByTenantIdSample.js +64 -0
- package/dist-esm/samples-dev/eventsListByTenantIdSample.js.map +1 -0
- package/dist-esm/samples-dev/impactedResourcesGetByTenantIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/impactedResourcesGetByTenantIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/impactedResourcesGetByTenantIdSample.js +39 -0
- package/dist-esm/samples-dev/impactedResourcesGetByTenantIdSample.js.map +1 -0
- package/dist-esm/samples-dev/impactedResourcesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/impactedResourcesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/impactedResourcesGetSample.js +38 -0
- package/dist-esm/samples-dev/impactedResourcesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/impactedResourcesListBySubscriptionIdAndEventIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/impactedResourcesListBySubscriptionIdAndEventIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/impactedResourcesListBySubscriptionIdAndEventIdSample.js +62 -0
- package/dist-esm/samples-dev/impactedResourcesListBySubscriptionIdAndEventIdSample.js.map +1 -0
- package/dist-esm/samples-dev/impactedResourcesListByTenantIdAndEventIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/impactedResourcesListByTenantIdAndEventIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/impactedResourcesListByTenantIdAndEventIdSample.js +63 -0
- package/dist-esm/samples-dev/impactedResourcesListByTenantIdAndEventIdSample.js.map +1 -0
- package/dist-esm/samples-dev/metadataGetEntitySample.d.ts +2 -0
- package/dist-esm/samples-dev/metadataGetEntitySample.d.ts.map +1 -0
- package/dist-esm/samples-dev/metadataGetEntitySample.js +38 -0
- package/dist-esm/samples-dev/metadataGetEntitySample.js.map +1 -0
- package/dist-esm/samples-dev/metadataListSample.d.ts +2 -0
- package/dist-esm/samples-dev/metadataListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/metadataListSample.js +58 -0
- package/dist-esm/samples-dev/metadataListSample.js.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.js +37 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.js +58 -0
- package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.js.map +1 -0
- package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.d.ts +2 -0
- package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.js +59 -0
- package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.js.map +1 -0
- package/dist-esm/src/microsoftResourceHealth.d.ts +8 -4
- package/dist-esm/src/microsoftResourceHealth.d.ts.map +1 -1
- package/dist-esm/src/microsoftResourceHealth.js +10 -6
- package/dist-esm/src/microsoftResourceHealth.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +657 -34
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +114 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts +24 -3
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +883 -100
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/models/parameters.d.ts +4 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -1
- package/dist-esm/src/models/parameters.js +51 -3
- package/dist-esm/src/models/parameters.js.map +1 -1
- package/dist-esm/src/operations/availabilityStatuses.d.ts +9 -15
- package/dist-esm/src/operations/availabilityStatuses.d.ts.map +1 -1
- package/dist-esm/src/operations/availabilityStatuses.js +9 -15
- package/dist-esm/src/operations/availabilityStatuses.js.map +1 -1
- package/dist-esm/src/operations/emergingIssues.d.ts +6 -5
- package/dist-esm/src/operations/emergingIssues.d.ts.map +1 -1
- package/dist-esm/src/operations/emergingIssues.js +15 -14
- package/dist-esm/src/operations/emergingIssues.js.map +1 -1
- package/dist-esm/src/operations/eventOperations.d.ts +39 -0
- package/dist-esm/src/operations/eventOperations.d.ts.map +1 -0
- package/dist-esm/src/operations/eventOperations.js +137 -0
- package/dist-esm/src/operations/eventOperations.js.map +1 -0
- package/dist-esm/src/operations/eventsOperations.d.ts +83 -0
- package/dist-esm/src/operations/eventsOperations.d.ts.map +1 -0
- package/dist-esm/src/operations/eventsOperations.js +393 -0
- package/dist-esm/src/operations/eventsOperations.js.map +1 -0
- package/dist-esm/src/operations/impactedResources.d.ts +72 -0
- package/dist-esm/src/operations/impactedResources.d.ts.map +1 -0
- package/dist-esm/src/operations/impactedResources.js +330 -0
- package/dist-esm/src/operations/impactedResources.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +6 -1
- package/dist-esm/src/operations/index.d.ts.map +1 -1
- package/dist-esm/src/operations/index.js +6 -1
- package/dist-esm/src/operations/index.js.map +1 -1
- package/dist-esm/src/operations/metadata.d.ts +38 -0
- package/dist-esm/src/operations/metadata.d.ts.map +1 -0
- package/dist-esm/src/operations/metadata.js +162 -0
- package/dist-esm/src/operations/metadata.js.map +1 -0
- package/dist-esm/src/operations/securityAdvisoryImpactedResources.d.ts +58 -0
- package/dist-esm/src/operations/securityAdvisoryImpactedResources.d.ts.map +1 -0
- package/dist-esm/src/operations/securityAdvisoryImpactedResources.js +271 -0
- package/dist-esm/src/operations/securityAdvisoryImpactedResources.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts +4 -7
- package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts +3 -2
- package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/eventOperations.d.ts +31 -0
- package/dist-esm/src/operationsInterfaces/eventOperations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/eventOperations.js +9 -0
- package/dist-esm/src/operationsInterfaces/eventOperations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/eventsOperations.d.ts +26 -0
- package/dist-esm/src/operationsInterfaces/eventsOperations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/eventsOperations.js +9 -0
- package/dist-esm/src/operationsInterfaces/eventsOperations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/impactedResources.d.ts +32 -0
- package/dist-esm/src/operationsInterfaces/impactedResources.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/impactedResources.js +9 -0
- package/dist-esm/src/operationsInterfaces/impactedResources.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +6 -1
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/index.js +6 -1
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
- package/dist-esm/src/operationsInterfaces/metadata.d.ts +17 -0
- package/dist-esm/src/operationsInterfaces/metadata.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/metadata.js +9 -0
- package/dist-esm/src/operationsInterfaces/metadata.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/securityAdvisoryImpactedResources.d.ts +18 -0
- package/dist-esm/src/operationsInterfaces/securityAdvisoryImpactedResources.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/securityAdvisoryImpactedResources.js +9 -0
- package/dist-esm/src/operationsInterfaces/securityAdvisoryImpactedResources.js.map +1 -0
- package/dist-esm/test/resourcehealth_operations_test.spec.d.ts +4 -0
- package/dist-esm/test/resourcehealth_operations_test.spec.d.ts.map +1 -0
- package/dist-esm/test/resourcehealth_operations_test.spec.js +56 -0
- package/dist-esm/test/resourcehealth_operations_test.spec.js.map +1 -0
- package/package.json +6 -6
- package/review/arm-resourcehealth.api.md +516 -8
- package/src/microsoftResourceHealth.ts +29 -8
- package/src/models/index.ts +757 -35
- package/src/models/mappers.ts +956 -101
- package/src/models/parameters.ts +55 -3
- package/src/operations/availabilityStatuses.ts +9 -15
- package/src/operations/emergingIssues.ts +24 -18
- package/src/operations/eventOperations.ts +184 -0
- package/src/operations/eventsOperations.ts +434 -0
- package/src/operations/impactedResources.ts +414 -0
- package/src/operations/index.ts +6 -1
- package/src/operations/metadata.ts +182 -0
- package/src/operations/securityAdvisoryImpactedResources.ts +342 -0
- package/src/operationsInterfaces/availabilityStatuses.ts +4 -7
- package/src/operationsInterfaces/emergingIssues.ts +3 -0
- package/src/operationsInterfaces/eventOperations.ts +60 -0
- package/src/operationsInterfaces/eventsOperations.ts +47 -0
- package/src/operationsInterfaces/impactedResources.ts +63 -0
- package/src/operationsInterfaces/index.ts +6 -1
- package/src/operationsInterfaces/metadata.ts +36 -0
- package/src/operationsInterfaces/securityAdvisoryImpactedResources.ts +37 -0
- package/types/arm-resourcehealth.d.ts +853 -23
- package/dist-esm/test/sampleTest.d.ts +0 -2
- package/dist-esm/test/sampleTest.d.ts.map +0 -1
- package/dist-esm/test/sampleTest.js +0 -38
- package/dist-esm/test/sampleTest.js.map +0 -1
@@ -0,0 +1,62 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import { __asyncValues, __awaiter } from "tslib";
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
10
|
+
// Licensed under the MIT License.
|
11
|
+
import { MicrosoftResourceHealth } from "@azure/arm-resourcehealth";
|
12
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
13
|
+
import * as dotenv from "dotenv";
|
14
|
+
dotenv.config();
|
15
|
+
/**
|
16
|
+
* This sample demonstrates how to Lists impacted resources in the subscription by an event.
|
17
|
+
*
|
18
|
+
* @summary Lists impacted resources in the subscription by an event.
|
19
|
+
* x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/ImpactedResources_ListBySubscriptionId_ListByEventId.json
|
20
|
+
*/
|
21
|
+
function listImpactedResourcesBySubscriptionId() {
|
22
|
+
var _a, e_1, _b, _c;
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
24
|
+
const subscriptionId = process.env["RESOURCEHEALTH_SUBSCRIPTION_ID"] || "subscriptionId";
|
25
|
+
const eventTrackingId = "BC_1-FXZ";
|
26
|
+
const filter = "targetRegion eq 'westus'";
|
27
|
+
const options = {
|
28
|
+
filter
|
29
|
+
};
|
30
|
+
const credential = new DefaultAzureCredential();
|
31
|
+
const client = new MicrosoftResourceHealth(credential, subscriptionId);
|
32
|
+
const resArray = new Array();
|
33
|
+
try {
|
34
|
+
for (var _d = true, _e = __asyncValues(client.impactedResources.listBySubscriptionIdAndEventId(eventTrackingId, options)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
|
35
|
+
_c = _f.value;
|
36
|
+
_d = false;
|
37
|
+
try {
|
38
|
+
let item = _c;
|
39
|
+
resArray.push(item);
|
40
|
+
}
|
41
|
+
finally {
|
42
|
+
_d = true;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
47
|
+
finally {
|
48
|
+
try {
|
49
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
50
|
+
}
|
51
|
+
finally { if (e_1) throw e_1.error; }
|
52
|
+
}
|
53
|
+
console.log(resArray);
|
54
|
+
});
|
55
|
+
}
|
56
|
+
function main() {
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
58
|
+
listImpactedResourcesBySubscriptionId();
|
59
|
+
});
|
60
|
+
}
|
61
|
+
main().catch(console.error);
|
62
|
+
//# sourceMappingURL=impactedResourcesListBySubscriptionIdAndEventIdSample.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"impactedResourcesListBySubscriptionIdAndEventIdSample.js","sourceRoot":"","sources":["../../samples-dev/impactedResourcesListBySubscriptionIdAndEventIdSample.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAEL,uBAAuB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;;;;;GAKG;AACH,SAAe,qCAAqC;;;QAClD,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,IAAI,gBAAgB,CAAC;QACpE,MAAM,eAAe,GAAG,UAAU,CAAC;QACnC,MAAM,MAAM,GAAG,0BAA0B,CAAC;QAC1C,MAAM,OAAO,GAAkE;YAC7E,MAAM;SACP,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACvE,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;;YAC7B,KAAuB,eAAA,KAAA,cAAA,MAAM,CAAC,iBAAiB,CAAC,8BAA8B,CAC5E,eAAe,EACf,OAAO,CACR,CAAA,IAAA;gBAHsB,cAGtB;gBAHsB,WAGtB;;oBAHU,IAAI,IAAI,KAAA,CAAA;oBAIjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;;aACrB;;;;;;;;;QACD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;;CACvB;AAED,SAAe,IAAI;;QACjB,qCAAqC,EAAE,CAAC;IAC1C,CAAC;CAAA;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"impactedResourcesListByTenantIdAndEventIdSample.d.ts","sourceRoot":"","sources":["../../samples-dev/impactedResourcesListByTenantIdAndEventIdSample.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import { __asyncValues, __awaiter } from "tslib";
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
10
|
+
// Licensed under the MIT License.
|
11
|
+
import { MicrosoftResourceHealth } from "@azure/arm-resourcehealth";
|
12
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
13
|
+
import * as dotenv from "dotenv";
|
14
|
+
dotenv.config();
|
15
|
+
/**
|
16
|
+
* This sample demonstrates how to Lists impacted resources in the tenant by an event.
|
17
|
+
*
|
18
|
+
* @summary Lists impacted resources in the tenant by an event.
|
19
|
+
* x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/ImpactedResources_ListByTenantId_ListByEventId.json
|
20
|
+
*/
|
21
|
+
function listEventsByTenantId() {
|
22
|
+
var _a, e_1, _b, _c;
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
24
|
+
const subscriptionId = process.env["RESOURCEHEALTH_SUBSCRIPTION_ID"] ||
|
25
|
+
"00000000-0000-0000-0000-000000000000";
|
26
|
+
const eventTrackingId = "BC_1-FXZ";
|
27
|
+
const filter = "targetRegion eq 'westus'";
|
28
|
+
const options = {
|
29
|
+
filter
|
30
|
+
};
|
31
|
+
const credential = new DefaultAzureCredential();
|
32
|
+
const client = new MicrosoftResourceHealth(credential, subscriptionId);
|
33
|
+
const resArray = new Array();
|
34
|
+
try {
|
35
|
+
for (var _d = true, _e = __asyncValues(client.impactedResources.listByTenantIdAndEventId(eventTrackingId, options)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
|
36
|
+
_c = _f.value;
|
37
|
+
_d = false;
|
38
|
+
try {
|
39
|
+
let item = _c;
|
40
|
+
resArray.push(item);
|
41
|
+
}
|
42
|
+
finally {
|
43
|
+
_d = true;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
48
|
+
finally {
|
49
|
+
try {
|
50
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
51
|
+
}
|
52
|
+
finally { if (e_1) throw e_1.error; }
|
53
|
+
}
|
54
|
+
console.log(resArray);
|
55
|
+
});
|
56
|
+
}
|
57
|
+
function main() {
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
59
|
+
listEventsByTenantId();
|
60
|
+
});
|
61
|
+
}
|
62
|
+
main().catch(console.error);
|
63
|
+
//# sourceMappingURL=impactedResourcesListByTenantIdAndEventIdSample.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"impactedResourcesListByTenantIdAndEventIdSample.js","sourceRoot":"","sources":["../../samples-dev/impactedResourcesListByTenantIdAndEventIdSample.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAEL,uBAAuB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;;;;;GAKG;AACH,SAAe,oBAAoB;;;QACjC,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;YAC7C,sCAAsC,CAAC;QACzC,MAAM,eAAe,GAAG,UAAU,CAAC;QACnC,MAAM,MAAM,GAAG,0BAA0B,CAAC;QAC1C,MAAM,OAAO,GAA4D;YACvE,MAAM;SACP,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACvE,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;;YAC7B,KAAuB,eAAA,KAAA,cAAA,MAAM,CAAC,iBAAiB,CAAC,wBAAwB,CACtE,eAAe,EACf,OAAO,CACR,CAAA,IAAA;gBAHsB,cAGtB;gBAHsB,WAGtB;;oBAHU,IAAI,IAAI,KAAA,CAAA;oBAIjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;;aACrB;;;;;;;;;QACD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;;CACvB;AAED,SAAe,IAAI;;QACjB,oBAAoB,EAAE,CAAC;IACzB,CAAC;CAAA;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"metadataGetEntitySample.d.ts","sourceRoot":"","sources":["../../samples-dev/metadataGetEntitySample.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import { __awaiter } from "tslib";
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
10
|
+
// Licensed under the MIT License.
|
11
|
+
import { MicrosoftResourceHealth } from "@azure/arm-resourcehealth";
|
12
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
13
|
+
import * as dotenv from "dotenv";
|
14
|
+
dotenv.config();
|
15
|
+
/**
|
16
|
+
* This sample demonstrates how to Gets the list of metadata entities.
|
17
|
+
*
|
18
|
+
* @summary Gets the list of metadata entities.
|
19
|
+
* x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/Metadata_GetEntity.json
|
20
|
+
*/
|
21
|
+
function getMetadata() {
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
23
|
+
const subscriptionId = process.env["RESOURCEHEALTH_SUBSCRIPTION_ID"] ||
|
24
|
+
"00000000-0000-0000-0000-000000000000";
|
25
|
+
const name = "status";
|
26
|
+
const credential = new DefaultAzureCredential();
|
27
|
+
const client = new MicrosoftResourceHealth(credential, subscriptionId);
|
28
|
+
const result = yield client.metadata.getEntity(name);
|
29
|
+
console.log(result);
|
30
|
+
});
|
31
|
+
}
|
32
|
+
function main() {
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
34
|
+
getMetadata();
|
35
|
+
});
|
36
|
+
}
|
37
|
+
main().catch(console.error);
|
38
|
+
//# sourceMappingURL=metadataGetEntitySample.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"metadataGetEntitySample.js","sourceRoot":"","sources":["../../samples-dev/metadataGetEntitySample.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;;;;;GAKG;AACH,SAAe,WAAW;;QACxB,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;YAC7C,sCAAsC,CAAC;QACzC,MAAM,IAAI,GAAG,QAAQ,CAAC;QACtB,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,SAAe,IAAI;;QACjB,WAAW,EAAE,CAAC;IAChB,CAAC;CAAA;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"metadataListSample.d.ts","sourceRoot":"","sources":["../../samples-dev/metadataListSample.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import { __asyncValues, __awaiter } from "tslib";
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
10
|
+
// Licensed under the MIT License.
|
11
|
+
import { MicrosoftResourceHealth } from "@azure/arm-resourcehealth";
|
12
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
13
|
+
import * as dotenv from "dotenv";
|
14
|
+
dotenv.config();
|
15
|
+
/**
|
16
|
+
* This sample demonstrates how to Gets the list of metadata entities.
|
17
|
+
*
|
18
|
+
* @summary Gets the list of metadata entities.
|
19
|
+
* x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/Metadata_List.json
|
20
|
+
*/
|
21
|
+
function getMetadata() {
|
22
|
+
var _a, e_1, _b, _c;
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
24
|
+
const subscriptionId = process.env["RESOURCEHEALTH_SUBSCRIPTION_ID"] ||
|
25
|
+
"00000000-0000-0000-0000-000000000000";
|
26
|
+
const credential = new DefaultAzureCredential();
|
27
|
+
const client = new MicrosoftResourceHealth(credential, subscriptionId);
|
28
|
+
const resArray = new Array();
|
29
|
+
try {
|
30
|
+
for (var _d = true, _e = __asyncValues(client.metadata.list()), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
|
31
|
+
_c = _f.value;
|
32
|
+
_d = false;
|
33
|
+
try {
|
34
|
+
let item = _c;
|
35
|
+
resArray.push(item);
|
36
|
+
}
|
37
|
+
finally {
|
38
|
+
_d = true;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
43
|
+
finally {
|
44
|
+
try {
|
45
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
46
|
+
}
|
47
|
+
finally { if (e_1) throw e_1.error; }
|
48
|
+
}
|
49
|
+
console.log(resArray);
|
50
|
+
});
|
51
|
+
}
|
52
|
+
function main() {
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
54
|
+
getMetadata();
|
55
|
+
});
|
56
|
+
}
|
57
|
+
main().catch(console.error);
|
58
|
+
//# sourceMappingURL=metadataListSample.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"metadataListSample.js","sourceRoot":"","sources":["../../samples-dev/metadataListSample.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;;;;;GAKG;AACH,SAAe,WAAW;;;QACxB,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;YAC7C,sCAAsC,CAAC;QACzC,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACvE,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;;YAC7B,KAAuB,eAAA,KAAA,cAAA,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAA,IAAA;gBAAtB,cAAsB;gBAAtB,WAAsB;;oBAAlC,IAAI,IAAI,KAAA,CAAA;oBACjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;;aACrB;;;;;;;;;QACD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;;CACvB;AAED,SAAe,IAAI;;QACjB,WAAW,EAAE,CAAC;IAChB,CAAC;CAAA;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"operationsListSample.d.ts","sourceRoot":"","sources":["../../samples-dev/operationsListSample.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import { __awaiter } from "tslib";
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
10
|
+
// Licensed under the MIT License.
|
11
|
+
import { MicrosoftResourceHealth } from "@azure/arm-resourcehealth";
|
12
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
13
|
+
import * as dotenv from "dotenv";
|
14
|
+
dotenv.config();
|
15
|
+
/**
|
16
|
+
* This sample demonstrates how to Lists available operations for the resourcehealth resource provider
|
17
|
+
*
|
18
|
+
* @summary Lists available operations for the resourcehealth resource provider
|
19
|
+
* x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/Operations_List.json
|
20
|
+
*/
|
21
|
+
function getOperationsList() {
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
23
|
+
const subscriptionId = process.env["RESOURCEHEALTH_SUBSCRIPTION_ID"] ||
|
24
|
+
"00000000-0000-0000-0000-000000000000";
|
25
|
+
const credential = new DefaultAzureCredential();
|
26
|
+
const client = new MicrosoftResourceHealth(credential, subscriptionId);
|
27
|
+
const result = yield client.operations.list();
|
28
|
+
console.log(result);
|
29
|
+
});
|
30
|
+
}
|
31
|
+
function main() {
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
33
|
+
getOperationsList();
|
34
|
+
});
|
35
|
+
}
|
36
|
+
main().catch(console.error);
|
37
|
+
//# sourceMappingURL=operationsListSample.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"operationsListSample.js","sourceRoot":"","sources":["../../samples-dev/operationsListSample.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;;;;;GAKG;AACH,SAAe,iBAAiB;;QAC9B,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;YAC7C,sCAAsC,CAAC;QACzC,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,SAAe,IAAI;;QACjB,iBAAiB,EAAE,CAAC;IACtB,CAAC;CAAA;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.d.ts","sourceRoot":"","sources":["../../samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import { __asyncValues, __awaiter } from "tslib";
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
10
|
+
// Licensed under the MIT License.
|
11
|
+
import { MicrosoftResourceHealth } from "@azure/arm-resourcehealth";
|
12
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
13
|
+
import * as dotenv from "dotenv";
|
14
|
+
dotenv.config();
|
15
|
+
/**
|
16
|
+
* This sample demonstrates how to Lists impacted resources in the subscription by an event (Security Advisory).
|
17
|
+
*
|
18
|
+
* @summary Lists impacted resources in the subscription by an event (Security Advisory).
|
19
|
+
* x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json
|
20
|
+
*/
|
21
|
+
function listSecurityAdvisoryImpactedResourcesBySubscriptionId() {
|
22
|
+
var _a, e_1, _b, _c;
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
24
|
+
const subscriptionId = process.env["RESOURCEHEALTH_SUBSCRIPTION_ID"] || "subscriptionId";
|
25
|
+
const eventTrackingId = "BC_1-FXZ";
|
26
|
+
const credential = new DefaultAzureCredential();
|
27
|
+
const client = new MicrosoftResourceHealth(credential, subscriptionId);
|
28
|
+
const resArray = new Array();
|
29
|
+
try {
|
30
|
+
for (var _d = true, _e = __asyncValues(client.securityAdvisoryImpactedResources.listBySubscriptionIdAndEventId(eventTrackingId)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
|
31
|
+
_c = _f.value;
|
32
|
+
_d = false;
|
33
|
+
try {
|
34
|
+
let item = _c;
|
35
|
+
resArray.push(item);
|
36
|
+
}
|
37
|
+
finally {
|
38
|
+
_d = true;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
43
|
+
finally {
|
44
|
+
try {
|
45
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
46
|
+
}
|
47
|
+
finally { if (e_1) throw e_1.error; }
|
48
|
+
}
|
49
|
+
console.log(resArray);
|
50
|
+
});
|
51
|
+
}
|
52
|
+
function main() {
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
54
|
+
listSecurityAdvisoryImpactedResourcesBySubscriptionId();
|
55
|
+
});
|
56
|
+
}
|
57
|
+
main().catch(console.error);
|
58
|
+
//# sourceMappingURL=securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.js","sourceRoot":"","sources":["../../samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;;;;;GAKG;AACH,SAAe,qDAAqD;;;QAClE,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,IAAI,gBAAgB,CAAC;QACpE,MAAM,eAAe,GAAG,UAAU,CAAC;QACnC,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACvE,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;;YAC7B,KAAuB,eAAA,KAAA,cAAA,MAAM,CAAC,iCAAiC,CAAC,8BAA8B,CAC5F,eAAe,CAChB,CAAA,IAAA;gBAFsB,cAEtB;gBAFsB,WAEtB;;oBAFU,IAAI,IAAI,KAAA,CAAA;oBAGjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;;aACrB;;;;;;;;;QACD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;;CACvB;AAED,SAAe,IAAI;;QACjB,qDAAqD,EAAE,CAAC;IAC1D,CAAC;CAAA;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.d.ts","sourceRoot":"","sources":["../../samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.ts"],"names":[],"mappings":""}
|
package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.js
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import { __asyncValues, __awaiter } from "tslib";
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
10
|
+
// Licensed under the MIT License.
|
11
|
+
import { MicrosoftResourceHealth } from "@azure/arm-resourcehealth";
|
12
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
13
|
+
import * as dotenv from "dotenv";
|
14
|
+
dotenv.config();
|
15
|
+
/**
|
16
|
+
* This sample demonstrates how to Lists impacted resources in the tenant by an event (Security Advisory).
|
17
|
+
*
|
18
|
+
* @summary Lists impacted resources in the tenant by an event (Security Advisory).
|
19
|
+
* x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json
|
20
|
+
*/
|
21
|
+
function listSecurityAdvisoryImpactedResourcesByTenantId() {
|
22
|
+
var _a, e_1, _b, _c;
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
24
|
+
const subscriptionId = process.env["RESOURCEHEALTH_SUBSCRIPTION_ID"] ||
|
25
|
+
"00000000-0000-0000-0000-000000000000";
|
26
|
+
const eventTrackingId = "BC_1-FXZ";
|
27
|
+
const credential = new DefaultAzureCredential();
|
28
|
+
const client = new MicrosoftResourceHealth(credential, subscriptionId);
|
29
|
+
const resArray = new Array();
|
30
|
+
try {
|
31
|
+
for (var _d = true, _e = __asyncValues(client.securityAdvisoryImpactedResources.listByTenantIdAndEventId(eventTrackingId)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
|
32
|
+
_c = _f.value;
|
33
|
+
_d = false;
|
34
|
+
try {
|
35
|
+
let item = _c;
|
36
|
+
resArray.push(item);
|
37
|
+
}
|
38
|
+
finally {
|
39
|
+
_d = true;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
44
|
+
finally {
|
45
|
+
try {
|
46
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
47
|
+
}
|
48
|
+
finally { if (e_1) throw e_1.error; }
|
49
|
+
}
|
50
|
+
console.log(resArray);
|
51
|
+
});
|
52
|
+
}
|
53
|
+
function main() {
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
55
|
+
listSecurityAdvisoryImpactedResourcesByTenantId();
|
56
|
+
});
|
57
|
+
}
|
58
|
+
main().catch(console.error);
|
59
|
+
//# sourceMappingURL=securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.js.map
|
package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.js","sourceRoot":"","sources":["../../samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;;;;;GAKG;AACH,SAAe,+CAA+C;;;QAC5D,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;YAC7C,sCAAsC,CAAC;QACzC,MAAM,eAAe,GAAG,UAAU,CAAC;QACnC,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACvE,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;;YAC7B,KAAuB,eAAA,KAAA,cAAA,MAAM,CAAC,iCAAiC,CAAC,wBAAwB,CACtF,eAAe,CAChB,CAAA,IAAA;gBAFsB,cAEtB;gBAFsB,WAEtB;;oBAFU,IAAI,IAAI,KAAA,CAAA;oBAGjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;;aACrB;;;;;;;;;QACD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;;CACvB;AAED,SAAe,IAAI;;QACjB,+CAA+C,EAAE,CAAC;IACpD,CAAC;CAAA;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as coreClient from "@azure/core-client";
|
2
2
|
import * as coreAuth from "@azure/core-auth";
|
3
|
-
import { AvailabilityStatuses, ChildAvailabilityStatuses, ChildResources,
|
3
|
+
import { AvailabilityStatuses, Operations, Metadata, ImpactedResources, SecurityAdvisoryImpactedResources, EventsOperations, EventOperations, ChildAvailabilityStatuses, ChildResources, EmergingIssues } from "./operationsInterfaces";
|
4
4
|
import { MicrosoftResourceHealthOptionalParams } from "./models";
|
5
5
|
export declare class MicrosoftResourceHealth extends coreClient.ServiceClient {
|
6
6
|
$host: string;
|
@@ -9,17 +9,21 @@ export declare class MicrosoftResourceHealth extends coreClient.ServiceClient {
|
|
9
9
|
/**
|
10
10
|
* Initializes a new instance of the MicrosoftResourceHealth class.
|
11
11
|
* @param credentials Subscription credentials which uniquely identify client subscription.
|
12
|
-
* @param subscriptionId
|
13
|
-
* The subscription ID forms part of the URI for every service call.
|
12
|
+
* @param subscriptionId The ID of the target subscription.
|
14
13
|
* @param options The parameter options
|
15
14
|
*/
|
16
15
|
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftResourceHealthOptionalParams);
|
17
16
|
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
18
17
|
private addCustomApiVersionPolicy;
|
19
18
|
availabilityStatuses: AvailabilityStatuses;
|
19
|
+
operations: Operations;
|
20
|
+
metadata: Metadata;
|
21
|
+
impactedResources: ImpactedResources;
|
22
|
+
securityAdvisoryImpactedResources: SecurityAdvisoryImpactedResources;
|
23
|
+
eventsOperations: EventsOperations;
|
24
|
+
eventOperations: EventOperations;
|
20
25
|
childAvailabilityStatuses: ChildAvailabilityStatuses;
|
21
26
|
childResources: ChildResources;
|
22
|
-
operations: Operations;
|
23
27
|
emergingIssues: EmergingIssues;
|
24
28
|
}
|
25
29
|
//# sourceMappingURL=microsoftResourceHealth.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"microsoftResourceHealth.d.ts","sourceRoot":"","sources":["../../src/microsoftResourceHealth.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAOjD,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"microsoftResourceHealth.d.ts","sourceRoot":"","sources":["../../src/microsoftResourceHealth.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAOjD,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAa7C,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,iCAAiC,EACjC,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAEjE,qBAAa,uBAAwB,SAAQ,UAAU,CAAC,aAAa;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;gBAED,WAAW,EAAE,QAAQ,CAAC,eAAe,EACrC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,qCAAqC;IAuFjD,8GAA8G;IAC9G,OAAO,CAAC,yBAAyB;IA2BjC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,iCAAiC,EAAE,iCAAiC,CAAC;IACrE,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,eAAe,EAAE,eAAe,CAAC;IACjC,yBAAyB,EAAE,yBAAyB,CAAC;IACrD,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;CAChC"}
|
@@ -8,13 +8,12 @@
|
|
8
8
|
import { __awaiter } from "tslib";
|
9
9
|
import * as coreClient from "@azure/core-client";
|
10
10
|
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
11
|
-
import { AvailabilityStatusesImpl, ChildAvailabilityStatusesImpl, ChildResourcesImpl,
|
11
|
+
import { AvailabilityStatusesImpl, OperationsImpl, MetadataImpl, ImpactedResourcesImpl, SecurityAdvisoryImpactedResourcesImpl, EventsOperationsImpl, EventOperationsImpl, ChildAvailabilityStatusesImpl, ChildResourcesImpl, EmergingIssuesImpl } from "./operations";
|
12
12
|
export class MicrosoftResourceHealth extends coreClient.ServiceClient {
|
13
13
|
/**
|
14
14
|
* Initializes a new instance of the MicrosoftResourceHealth class.
|
15
15
|
* @param credentials Subscription credentials which uniquely identify client subscription.
|
16
|
-
* @param subscriptionId
|
17
|
-
* The subscription ID forms part of the URI for every service call.
|
16
|
+
* @param subscriptionId The ID of the target subscription.
|
18
17
|
* @param options The parameter options
|
19
18
|
*/
|
20
19
|
constructor(credentials, subscriptionId, options) {
|
@@ -33,7 +32,7 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient {
|
|
33
32
|
requestContentType: "application/json; charset=utf-8",
|
34
33
|
credential: credentials
|
35
34
|
};
|
36
|
-
const packageDetails = `azsdk-js-arm-resourcehealth/
|
35
|
+
const packageDetails = `azsdk-js-arm-resourcehealth/4.0.0`;
|
37
36
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
38
37
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
39
38
|
: `${packageDetails}`;
|
@@ -66,11 +65,16 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient {
|
|
66
65
|
this.subscriptionId = subscriptionId;
|
67
66
|
// Assigning values to Constant parameters
|
68
67
|
this.$host = options.$host || "https://management.azure.com";
|
69
|
-
this.apiVersion = options.apiVersion || "
|
68
|
+
this.apiVersion = options.apiVersion || "2022-10-01";
|
70
69
|
this.availabilityStatuses = new AvailabilityStatusesImpl(this);
|
70
|
+
this.operations = new OperationsImpl(this);
|
71
|
+
this.metadata = new MetadataImpl(this);
|
72
|
+
this.impactedResources = new ImpactedResourcesImpl(this);
|
73
|
+
this.securityAdvisoryImpactedResources = new SecurityAdvisoryImpactedResourcesImpl(this);
|
74
|
+
this.eventsOperations = new EventsOperationsImpl(this);
|
75
|
+
this.eventOperations = new EventOperationsImpl(this);
|
71
76
|
this.childAvailabilityStatuses = new ChildAvailabilityStatusesImpl(this);
|
72
77
|
this.childResources = new ChildResourcesImpl(this);
|
73
|
-
this.operations = new OperationsImpl(this);
|
74
78
|
this.emergingIssues = new EmergingIssuesImpl(this);
|
75
79
|
this.addCustomApiVersionPolicy(options.apiVersion);
|
76
80
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"microsoftResourceHealth.js","sourceRoot":"","sources":["../../src/microsoftResourceHealth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAO9D,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,kBAAkB,EAClB,
|
1
|
+
{"version":3,"file":"microsoftResourceHealth.js","sourceRoot":"","sources":["../../src/microsoftResourceHealth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAO9D,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,qCAAqC,EACrC,oBAAoB,EACpB,mBAAmB,EACnB,6BAA6B,EAC7B,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAetB,MAAM,O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