@azure/arm-resourcehealth 3.2.1-alpha.20230522.1 → 4.0.1-alpha.20230524.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +114 -1
- 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 +4 -4
- 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,434 @@
|
|
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
|
+
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
11
|
+
import { EventsOperations } from "../operationsInterfaces";
|
12
|
+
import * as coreClient from "@azure/core-client";
|
13
|
+
import * as Mappers from "../models/mappers";
|
14
|
+
import * as Parameters from "../models/parameters";
|
15
|
+
import { MicrosoftResourceHealth } from "../microsoftResourceHealth";
|
16
|
+
import {
|
17
|
+
Event,
|
18
|
+
EventsListBySubscriptionIdNextOptionalParams,
|
19
|
+
EventsListBySubscriptionIdOptionalParams,
|
20
|
+
EventsListBySubscriptionIdResponse,
|
21
|
+
EventsListByTenantIdNextOptionalParams,
|
22
|
+
EventsListByTenantIdOptionalParams,
|
23
|
+
EventsListByTenantIdResponse,
|
24
|
+
EventsListBySingleResourceNextOptionalParams,
|
25
|
+
EventsListBySingleResourceOptionalParams,
|
26
|
+
EventsListBySingleResourceResponse,
|
27
|
+
EventsListBySubscriptionIdNextResponse,
|
28
|
+
EventsListByTenantIdNextResponse,
|
29
|
+
EventsListBySingleResourceNextResponse
|
30
|
+
} from "../models";
|
31
|
+
|
32
|
+
/// <reference lib="esnext.asynciterable" />
|
33
|
+
/** Class containing EventsOperations operations. */
|
34
|
+
export class EventsOperationsImpl implements EventsOperations {
|
35
|
+
private readonly client: MicrosoftResourceHealth;
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Initialize a new instance of the class EventsOperations class.
|
39
|
+
* @param client Reference to the service client
|
40
|
+
*/
|
41
|
+
constructor(client: MicrosoftResourceHealth) {
|
42
|
+
this.client = client;
|
43
|
+
}
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Lists service health events in the subscription.
|
47
|
+
* @param options The options parameters.
|
48
|
+
*/
|
49
|
+
public listBySubscriptionId(
|
50
|
+
options?: EventsListBySubscriptionIdOptionalParams
|
51
|
+
): PagedAsyncIterableIterator<Event> {
|
52
|
+
const iter = this.listBySubscriptionIdPagingAll(options);
|
53
|
+
return {
|
54
|
+
next() {
|
55
|
+
return iter.next();
|
56
|
+
},
|
57
|
+
[Symbol.asyncIterator]() {
|
58
|
+
return this;
|
59
|
+
},
|
60
|
+
byPage: (settings?: PageSettings) => {
|
61
|
+
if (settings?.maxPageSize) {
|
62
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
63
|
+
}
|
64
|
+
return this.listBySubscriptionIdPagingPage(options, settings);
|
65
|
+
}
|
66
|
+
};
|
67
|
+
}
|
68
|
+
|
69
|
+
private async *listBySubscriptionIdPagingPage(
|
70
|
+
options?: EventsListBySubscriptionIdOptionalParams,
|
71
|
+
settings?: PageSettings
|
72
|
+
): AsyncIterableIterator<Event[]> {
|
73
|
+
let result: EventsListBySubscriptionIdResponse;
|
74
|
+
let continuationToken = settings?.continuationToken;
|
75
|
+
if (!continuationToken) {
|
76
|
+
result = await this._listBySubscriptionId(options);
|
77
|
+
let page = result.value || [];
|
78
|
+
continuationToken = result.nextLink;
|
79
|
+
setContinuationToken(page, continuationToken);
|
80
|
+
yield page;
|
81
|
+
}
|
82
|
+
while (continuationToken) {
|
83
|
+
result = await this._listBySubscriptionIdNext(continuationToken, options);
|
84
|
+
continuationToken = result.nextLink;
|
85
|
+
let page = result.value || [];
|
86
|
+
setContinuationToken(page, continuationToken);
|
87
|
+
yield page;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
private async *listBySubscriptionIdPagingAll(
|
92
|
+
options?: EventsListBySubscriptionIdOptionalParams
|
93
|
+
): AsyncIterableIterator<Event> {
|
94
|
+
for await (const page of this.listBySubscriptionIdPagingPage(options)) {
|
95
|
+
yield* page;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
/**
|
100
|
+
* Lists current service health events in the tenant.
|
101
|
+
* @param options The options parameters.
|
102
|
+
*/
|
103
|
+
public listByTenantId(
|
104
|
+
options?: EventsListByTenantIdOptionalParams
|
105
|
+
): PagedAsyncIterableIterator<Event> {
|
106
|
+
const iter = this.listByTenantIdPagingAll(options);
|
107
|
+
return {
|
108
|
+
next() {
|
109
|
+
return iter.next();
|
110
|
+
},
|
111
|
+
[Symbol.asyncIterator]() {
|
112
|
+
return this;
|
113
|
+
},
|
114
|
+
byPage: (settings?: PageSettings) => {
|
115
|
+
if (settings?.maxPageSize) {
|
116
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
117
|
+
}
|
118
|
+
return this.listByTenantIdPagingPage(options, settings);
|
119
|
+
}
|
120
|
+
};
|
121
|
+
}
|
122
|
+
|
123
|
+
private async *listByTenantIdPagingPage(
|
124
|
+
options?: EventsListByTenantIdOptionalParams,
|
125
|
+
settings?: PageSettings
|
126
|
+
): AsyncIterableIterator<Event[]> {
|
127
|
+
let result: EventsListByTenantIdResponse;
|
128
|
+
let continuationToken = settings?.continuationToken;
|
129
|
+
if (!continuationToken) {
|
130
|
+
result = await this._listByTenantId(options);
|
131
|
+
let page = result.value || [];
|
132
|
+
continuationToken = result.nextLink;
|
133
|
+
setContinuationToken(page, continuationToken);
|
134
|
+
yield page;
|
135
|
+
}
|
136
|
+
while (continuationToken) {
|
137
|
+
result = await this._listByTenantIdNext(continuationToken, options);
|
138
|
+
continuationToken = result.nextLink;
|
139
|
+
let page = result.value || [];
|
140
|
+
setContinuationToken(page, continuationToken);
|
141
|
+
yield page;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
private async *listByTenantIdPagingAll(
|
146
|
+
options?: EventsListByTenantIdOptionalParams
|
147
|
+
): AsyncIterableIterator<Event> {
|
148
|
+
for await (const page of this.listByTenantIdPagingPage(options)) {
|
149
|
+
yield* page;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
/**
|
154
|
+
* Lists current service health events for given resource.
|
155
|
+
* @param resourceUri The fully qualified ID of the resource, including the resource name and resource
|
156
|
+
* type. Currently the API support not nested and one nesting level resource types :
|
157
|
+
* /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
158
|
+
* and
|
159
|
+
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
160
|
+
* @param options The options parameters.
|
161
|
+
*/
|
162
|
+
public listBySingleResource(
|
163
|
+
resourceUri: string,
|
164
|
+
options?: EventsListBySingleResourceOptionalParams
|
165
|
+
): PagedAsyncIterableIterator<Event> {
|
166
|
+
const iter = this.listBySingleResourcePagingAll(resourceUri, options);
|
167
|
+
return {
|
168
|
+
next() {
|
169
|
+
return iter.next();
|
170
|
+
},
|
171
|
+
[Symbol.asyncIterator]() {
|
172
|
+
return this;
|
173
|
+
},
|
174
|
+
byPage: (settings?: PageSettings) => {
|
175
|
+
if (settings?.maxPageSize) {
|
176
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
177
|
+
}
|
178
|
+
return this.listBySingleResourcePagingPage(
|
179
|
+
resourceUri,
|
180
|
+
options,
|
181
|
+
settings
|
182
|
+
);
|
183
|
+
}
|
184
|
+
};
|
185
|
+
}
|
186
|
+
|
187
|
+
private async *listBySingleResourcePagingPage(
|
188
|
+
resourceUri: string,
|
189
|
+
options?: EventsListBySingleResourceOptionalParams,
|
190
|
+
settings?: PageSettings
|
191
|
+
): AsyncIterableIterator<Event[]> {
|
192
|
+
let result: EventsListBySingleResourceResponse;
|
193
|
+
let continuationToken = settings?.continuationToken;
|
194
|
+
if (!continuationToken) {
|
195
|
+
result = await this._listBySingleResource(resourceUri, options);
|
196
|
+
let page = result.value || [];
|
197
|
+
continuationToken = result.nextLink;
|
198
|
+
setContinuationToken(page, continuationToken);
|
199
|
+
yield page;
|
200
|
+
}
|
201
|
+
while (continuationToken) {
|
202
|
+
result = await this._listBySingleResourceNext(
|
203
|
+
resourceUri,
|
204
|
+
continuationToken,
|
205
|
+
options
|
206
|
+
);
|
207
|
+
continuationToken = result.nextLink;
|
208
|
+
let page = result.value || [];
|
209
|
+
setContinuationToken(page, continuationToken);
|
210
|
+
yield page;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
|
214
|
+
private async *listBySingleResourcePagingAll(
|
215
|
+
resourceUri: string,
|
216
|
+
options?: EventsListBySingleResourceOptionalParams
|
217
|
+
): AsyncIterableIterator<Event> {
|
218
|
+
for await (const page of this.listBySingleResourcePagingPage(
|
219
|
+
resourceUri,
|
220
|
+
options
|
221
|
+
)) {
|
222
|
+
yield* page;
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
/**
|
227
|
+
* Lists service health events in the subscription.
|
228
|
+
* @param options The options parameters.
|
229
|
+
*/
|
230
|
+
private _listBySubscriptionId(
|
231
|
+
options?: EventsListBySubscriptionIdOptionalParams
|
232
|
+
): Promise<EventsListBySubscriptionIdResponse> {
|
233
|
+
return this.client.sendOperationRequest(
|
234
|
+
{ options },
|
235
|
+
listBySubscriptionIdOperationSpec
|
236
|
+
);
|
237
|
+
}
|
238
|
+
|
239
|
+
/**
|
240
|
+
* Lists current service health events in the tenant.
|
241
|
+
* @param options The options parameters.
|
242
|
+
*/
|
243
|
+
private _listByTenantId(
|
244
|
+
options?: EventsListByTenantIdOptionalParams
|
245
|
+
): Promise<EventsListByTenantIdResponse> {
|
246
|
+
return this.client.sendOperationRequest(
|
247
|
+
{ options },
|
248
|
+
listByTenantIdOperationSpec
|
249
|
+
);
|
250
|
+
}
|
251
|
+
|
252
|
+
/**
|
253
|
+
* Lists current service health events for given resource.
|
254
|
+
* @param resourceUri The fully qualified ID of the resource, including the resource name and resource
|
255
|
+
* type. Currently the API support not nested and one nesting level resource types :
|
256
|
+
* /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
257
|
+
* and
|
258
|
+
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
259
|
+
* @param options The options parameters.
|
260
|
+
*/
|
261
|
+
private _listBySingleResource(
|
262
|
+
resourceUri: string,
|
263
|
+
options?: EventsListBySingleResourceOptionalParams
|
264
|
+
): Promise<EventsListBySingleResourceResponse> {
|
265
|
+
return this.client.sendOperationRequest(
|
266
|
+
{ resourceUri, options },
|
267
|
+
listBySingleResourceOperationSpec
|
268
|
+
);
|
269
|
+
}
|
270
|
+
|
271
|
+
/**
|
272
|
+
* ListBySubscriptionIdNext
|
273
|
+
* @param nextLink The nextLink from the previous successful call to the ListBySubscriptionId method.
|
274
|
+
* @param options The options parameters.
|
275
|
+
*/
|
276
|
+
private _listBySubscriptionIdNext(
|
277
|
+
nextLink: string,
|
278
|
+
options?: EventsListBySubscriptionIdNextOptionalParams
|
279
|
+
): Promise<EventsListBySubscriptionIdNextResponse> {
|
280
|
+
return this.client.sendOperationRequest(
|
281
|
+
{ nextLink, options },
|
282
|
+
listBySubscriptionIdNextOperationSpec
|
283
|
+
);
|
284
|
+
}
|
285
|
+
|
286
|
+
/**
|
287
|
+
* ListByTenantIdNext
|
288
|
+
* @param nextLink The nextLink from the previous successful call to the ListByTenantId method.
|
289
|
+
* @param options The options parameters.
|
290
|
+
*/
|
291
|
+
private _listByTenantIdNext(
|
292
|
+
nextLink: string,
|
293
|
+
options?: EventsListByTenantIdNextOptionalParams
|
294
|
+
): Promise<EventsListByTenantIdNextResponse> {
|
295
|
+
return this.client.sendOperationRequest(
|
296
|
+
{ nextLink, options },
|
297
|
+
listByTenantIdNextOperationSpec
|
298
|
+
);
|
299
|
+
}
|
300
|
+
|
301
|
+
/**
|
302
|
+
* ListBySingleResourceNext
|
303
|
+
* @param resourceUri The fully qualified ID of the resource, including the resource name and resource
|
304
|
+
* type. Currently the API support not nested and one nesting level resource types :
|
305
|
+
* /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
306
|
+
* and
|
307
|
+
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
308
|
+
* @param nextLink The nextLink from the previous successful call to the ListBySingleResource method.
|
309
|
+
* @param options The options parameters.
|
310
|
+
*/
|
311
|
+
private _listBySingleResourceNext(
|
312
|
+
resourceUri: string,
|
313
|
+
nextLink: string,
|
314
|
+
options?: EventsListBySingleResourceNextOptionalParams
|
315
|
+
): Promise<EventsListBySingleResourceNextResponse> {
|
316
|
+
return this.client.sendOperationRequest(
|
317
|
+
{ resourceUri, nextLink, options },
|
318
|
+
listBySingleResourceNextOperationSpec
|
319
|
+
);
|
320
|
+
}
|
321
|
+
}
|
322
|
+
// Operation Specifications
|
323
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
324
|
+
|
325
|
+
const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = {
|
326
|
+
path:
|
327
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events",
|
328
|
+
httpMethod: "GET",
|
329
|
+
responses: {
|
330
|
+
200: {
|
331
|
+
bodyMapper: Mappers.Events
|
332
|
+
},
|
333
|
+
default: {
|
334
|
+
bodyMapper: Mappers.ErrorResponse
|
335
|
+
}
|
336
|
+
},
|
337
|
+
queryParameters: [
|
338
|
+
Parameters.apiVersion,
|
339
|
+
Parameters.filter,
|
340
|
+
Parameters.queryStartTime
|
341
|
+
],
|
342
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
343
|
+
headerParameters: [Parameters.accept],
|
344
|
+
serializer
|
345
|
+
};
|
346
|
+
const listByTenantIdOperationSpec: coreClient.OperationSpec = {
|
347
|
+
path: "/providers/Microsoft.ResourceHealth/events",
|
348
|
+
httpMethod: "GET",
|
349
|
+
responses: {
|
350
|
+
200: {
|
351
|
+
bodyMapper: Mappers.Events
|
352
|
+
},
|
353
|
+
default: {
|
354
|
+
bodyMapper: Mappers.ErrorResponse
|
355
|
+
}
|
356
|
+
},
|
357
|
+
queryParameters: [
|
358
|
+
Parameters.apiVersion,
|
359
|
+
Parameters.filter,
|
360
|
+
Parameters.queryStartTime
|
361
|
+
],
|
362
|
+
urlParameters: [Parameters.$host],
|
363
|
+
headerParameters: [Parameters.accept],
|
364
|
+
serializer
|
365
|
+
};
|
366
|
+
const listBySingleResourceOperationSpec: coreClient.OperationSpec = {
|
367
|
+
path: "/{resourceUri}/providers/Microsoft.ResourceHealth/events",
|
368
|
+
httpMethod: "GET",
|
369
|
+
responses: {
|
370
|
+
200: {
|
371
|
+
bodyMapper: Mappers.Events
|
372
|
+
},
|
373
|
+
default: {
|
374
|
+
bodyMapper: Mappers.ErrorResponse
|
375
|
+
}
|
376
|
+
},
|
377
|
+
queryParameters: [Parameters.apiVersion, Parameters.filter],
|
378
|
+
urlParameters: [Parameters.$host, Parameters.resourceUri],
|
379
|
+
headerParameters: [Parameters.accept],
|
380
|
+
serializer
|
381
|
+
};
|
382
|
+
const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = {
|
383
|
+
path: "{nextLink}",
|
384
|
+
httpMethod: "GET",
|
385
|
+
responses: {
|
386
|
+
200: {
|
387
|
+
bodyMapper: Mappers.Events
|
388
|
+
},
|
389
|
+
default: {
|
390
|
+
bodyMapper: Mappers.ErrorResponse
|
391
|
+
}
|
392
|
+
},
|
393
|
+
urlParameters: [
|
394
|
+
Parameters.$host,
|
395
|
+
Parameters.subscriptionId,
|
396
|
+
Parameters.nextLink
|
397
|
+
],
|
398
|
+
headerParameters: [Parameters.accept],
|
399
|
+
serializer
|
400
|
+
};
|
401
|
+
const listByTenantIdNextOperationSpec: coreClient.OperationSpec = {
|
402
|
+
path: "{nextLink}",
|
403
|
+
httpMethod: "GET",
|
404
|
+
responses: {
|
405
|
+
200: {
|
406
|
+
bodyMapper: Mappers.Events
|
407
|
+
},
|
408
|
+
default: {
|
409
|
+
bodyMapper: Mappers.ErrorResponse
|
410
|
+
}
|
411
|
+
},
|
412
|
+
urlParameters: [Parameters.$host, Parameters.nextLink],
|
413
|
+
headerParameters: [Parameters.accept],
|
414
|
+
serializer
|
415
|
+
};
|
416
|
+
const listBySingleResourceNextOperationSpec: coreClient.OperationSpec = {
|
417
|
+
path: "{nextLink}",
|
418
|
+
httpMethod: "GET",
|
419
|
+
responses: {
|
420
|
+
200: {
|
421
|
+
bodyMapper: Mappers.Events
|
422
|
+
},
|
423
|
+
default: {
|
424
|
+
bodyMapper: Mappers.ErrorResponse
|
425
|
+
}
|
426
|
+
},
|
427
|
+
urlParameters: [
|
428
|
+
Parameters.$host,
|
429
|
+
Parameters.resourceUri,
|
430
|
+
Parameters.nextLink
|
431
|
+
],
|
432
|
+
headerParameters: [Parameters.accept],
|
433
|
+
serializer
|
434
|
+
};
|