@azure/arm-scvmm 1.0.0-beta.2 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -1
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/index.js +305 -130
- 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/availabilitySetsCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/availabilitySetsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/availabilitySetsDeleteSample.js +11 -3
- package/dist-esm/samples-dev/availabilitySetsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/availabilitySetsGetSample.js +11 -3
- package/dist-esm/samples-dev/availabilitySetsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/availabilitySetsListByResourceGroupSample.js +11 -3
- package/dist-esm/samples-dev/availabilitySetsListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/availabilitySetsListBySubscriptionSample.js +10 -2
- package/dist-esm/samples-dev/availabilitySetsListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/availabilitySetsUpdateSample.js +11 -3
- package/dist-esm/samples-dev/availabilitySetsUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/cloudsCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/cloudsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/cloudsDeleteSample.js +11 -3
- package/dist-esm/samples-dev/cloudsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/cloudsGetSample.js +11 -3
- package/dist-esm/samples-dev/cloudsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/cloudsListByResourceGroupSample.js +11 -3
- package/dist-esm/samples-dev/cloudsListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/cloudsListBySubscriptionSample.js +10 -2
- package/dist-esm/samples-dev/cloudsListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/cloudsUpdateSample.js +11 -3
- package/dist-esm/samples-dev/cloudsUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/inventoryItemsCreateSample.js +11 -3
- package/dist-esm/samples-dev/inventoryItemsCreateSample.js.map +1 -1
- package/dist-esm/samples-dev/inventoryItemsDeleteSample.js +11 -3
- package/dist-esm/samples-dev/inventoryItemsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/inventoryItemsGetSample.js +11 -3
- package/dist-esm/samples-dev/inventoryItemsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/inventoryItemsListByVmmServerSample.js +11 -3
- package/dist-esm/samples-dev/inventoryItemsListByVmmServerSample.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +10 -2
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachineTemplatesCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachineTemplatesCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachineTemplatesDeleteSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachineTemplatesDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachineTemplatesGetSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachineTemplatesGetSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachineTemplatesListByResourceGroupSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachineTemplatesListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachineTemplatesListBySubscriptionSample.js +10 -2
- package/dist-esm/samples-dev/virtualMachineTemplatesListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachineTemplatesUpdateSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachineTemplatesUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesCreateCheckpointSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesCreateCheckpointSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesDeleteCheckpointSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesDeleteCheckpointSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesDeleteSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesGetSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesGetSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesListByResourceGroupSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesListBySubscriptionSample.js +10 -2
- package/dist-esm/samples-dev/virtualMachinesListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesRestartSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesRestartSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesRestoreCheckpointSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesRestoreCheckpointSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesStartSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesStartSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesStopSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesStopSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualMachinesUpdateSample.js +11 -3
- package/dist-esm/samples-dev/virtualMachinesUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualNetworksCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/virtualNetworksCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualNetworksDeleteSample.js +11 -3
- package/dist-esm/samples-dev/virtualNetworksDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualNetworksGetSample.js +11 -3
- package/dist-esm/samples-dev/virtualNetworksGetSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualNetworksListByResourceGroupSample.js +11 -3
- package/dist-esm/samples-dev/virtualNetworksListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualNetworksListBySubscriptionSample.js +10 -2
- package/dist-esm/samples-dev/virtualNetworksListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualNetworksUpdateSample.js +11 -3
- package/dist-esm/samples-dev/virtualNetworksUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/vmmServersCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/vmmServersCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/vmmServersDeleteSample.js +11 -3
- package/dist-esm/samples-dev/vmmServersDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/vmmServersGetSample.js +11 -3
- package/dist-esm/samples-dev/vmmServersGetSample.js.map +1 -1
- package/dist-esm/samples-dev/vmmServersListByResourceGroupSample.js +11 -3
- package/dist-esm/samples-dev/vmmServersListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/vmmServersListBySubscriptionSample.js +10 -2
- package/dist-esm/samples-dev/vmmServersListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/vmmServersUpdateSample.js +11 -3
- package/dist-esm/samples-dev/vmmServersUpdateSample.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/operations/availabilitySets.d.ts.map +1 -1
- package/dist-esm/src/operations/availabilitySets.js +37 -16
- package/dist-esm/src/operations/availabilitySets.js.map +1 -1
- package/dist-esm/src/operations/clouds.d.ts.map +1 -1
- package/dist-esm/src/operations/clouds.js +37 -16
- package/dist-esm/src/operations/clouds.js.map +1 -1
- package/dist-esm/src/operations/inventoryItems.d.ts.map +1 -1
- package/dist-esm/src/operations/inventoryItems.js +19 -8
- package/dist-esm/src/operations/inventoryItems.js.map +1 -1
- package/dist-esm/src/operations/operations.d.ts.map +1 -1
- package/dist-esm/src/operations/operations.js +19 -8
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operations/virtualMachineTemplates.d.ts.map +1 -1
- package/dist-esm/src/operations/virtualMachineTemplates.js +37 -16
- package/dist-esm/src/operations/virtualMachineTemplates.js.map +1 -1
- package/dist-esm/src/operations/virtualMachines.d.ts.map +1 -1
- package/dist-esm/src/operations/virtualMachines.js +37 -16
- package/dist-esm/src/operations/virtualMachines.js.map +1 -1
- package/dist-esm/src/operations/virtualNetworks.d.ts.map +1 -1
- package/dist-esm/src/operations/virtualNetworks.js +37 -16
- package/dist-esm/src/operations/virtualNetworks.js.map +1 -1
- package/dist-esm/src/operations/vmmServers.d.ts.map +1 -1
- package/dist-esm/src/operations/vmmServers.js +37 -16
- package/dist-esm/src/operations/vmmServers.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/src/scvmm.d.ts.map +1 -1
- package/dist-esm/src/scvmm.js +20 -18
- package/dist-esm/src/scvmm.js.map +1 -1
- package/package.json +8 -6
- package/review/arm-scvmm.api.md +3 -0
- package/src/index.ts +1 -0
- package/src/operations/availabilitySets.ts +46 -19
- package/src/operations/clouds.ts +46 -19
- package/src/operations/inventoryItems.ts +27 -14
- package/src/operations/operations.ts +21 -9
- package/src/operations/virtualMachineTemplates.ts +46 -19
- package/src/operations/virtualMachines.ts +46 -19
- package/src/operations/virtualNetworks.ts +46 -19
- package/src/operations/vmmServers.ts +46 -19
- package/src/pagingHelper.ts +39 -0
- package/src/scvmm.ts +26 -20
- package/types/arm-scvmm.d.ts +9 -0
- package/types/tsdoc-metadata.json +1 -1
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { Operations } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -48,22 +49,34 @@ export class OperationsImpl implements Operations {
|
|
|
48
49
|
[Symbol.asyncIterator]() {
|
|
49
50
|
return this;
|
|
50
51
|
},
|
|
51
|
-
byPage: () => {
|
|
52
|
-
|
|
52
|
+
byPage: (settings?: PageSettings) => {
|
|
53
|
+
if (settings?.maxPageSize) {
|
|
54
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
55
|
+
}
|
|
56
|
+
return this.listPagingPage(options, settings);
|
|
53
57
|
}
|
|
54
58
|
};
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
private async *listPagingPage(
|
|
58
|
-
options?: OperationsListOptionalParams
|
|
62
|
+
options?: OperationsListOptionalParams,
|
|
63
|
+
settings?: PageSettings
|
|
59
64
|
): AsyncIterableIterator<ResourceProviderOperation[]> {
|
|
60
|
-
let result
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
let result: OperationsListResponse;
|
|
66
|
+
let continuationToken = settings?.continuationToken;
|
|
67
|
+
if (!continuationToken) {
|
|
68
|
+
result = await this._list(options);
|
|
69
|
+
let page = result.value || [];
|
|
70
|
+
continuationToken = result.nextLink;
|
|
71
|
+
setContinuationToken(page, continuationToken);
|
|
72
|
+
yield page;
|
|
73
|
+
}
|
|
63
74
|
while (continuationToken) {
|
|
64
75
|
result = await this._listNext(continuationToken, options);
|
|
65
76
|
continuationToken = result.nextLink;
|
|
66
|
-
|
|
77
|
+
let page = result.value || [];
|
|
78
|
+
setContinuationToken(page, continuationToken);
|
|
79
|
+
yield page;
|
|
67
80
|
}
|
|
68
81
|
}
|
|
69
82
|
|
|
@@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
130
143
|
bodyMapper: Mappers.ErrorResponse
|
|
131
144
|
}
|
|
132
145
|
},
|
|
133
|
-
queryParameters: [Parameters.apiVersion],
|
|
134
146
|
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
135
147
|
headerParameters: [Parameters.accept],
|
|
136
148
|
serializer
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { VirtualMachineTemplates } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -18,8 +19,10 @@ import {
|
|
|
18
19
|
VirtualMachineTemplate,
|
|
19
20
|
VirtualMachineTemplatesListByResourceGroupNextOptionalParams,
|
|
20
21
|
VirtualMachineTemplatesListByResourceGroupOptionalParams,
|
|
22
|
+
VirtualMachineTemplatesListByResourceGroupResponse,
|
|
21
23
|
VirtualMachineTemplatesListBySubscriptionNextOptionalParams,
|
|
22
24
|
VirtualMachineTemplatesListBySubscriptionOptionalParams,
|
|
25
|
+
VirtualMachineTemplatesListBySubscriptionResponse,
|
|
23
26
|
VirtualMachineTemplatesGetOptionalParams,
|
|
24
27
|
VirtualMachineTemplatesGetResponse,
|
|
25
28
|
VirtualMachineTemplatesCreateOrUpdateOptionalParams,
|
|
@@ -28,8 +31,6 @@ import {
|
|
|
28
31
|
ResourcePatch,
|
|
29
32
|
VirtualMachineTemplatesUpdateOptionalParams,
|
|
30
33
|
VirtualMachineTemplatesUpdateResponse,
|
|
31
|
-
VirtualMachineTemplatesListByResourceGroupResponse,
|
|
32
|
-
VirtualMachineTemplatesListBySubscriptionResponse,
|
|
33
34
|
VirtualMachineTemplatesListByResourceGroupNextResponse,
|
|
34
35
|
VirtualMachineTemplatesListBySubscriptionNextResponse
|
|
35
36
|
} from "../models";
|
|
@@ -64,19 +65,33 @@ export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates {
|
|
|
64
65
|
[Symbol.asyncIterator]() {
|
|
65
66
|
return this;
|
|
66
67
|
},
|
|
67
|
-
byPage: () => {
|
|
68
|
-
|
|
68
|
+
byPage: (settings?: PageSettings) => {
|
|
69
|
+
if (settings?.maxPageSize) {
|
|
70
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
71
|
+
}
|
|
72
|
+
return this.listByResourceGroupPagingPage(
|
|
73
|
+
resourceGroupName,
|
|
74
|
+
options,
|
|
75
|
+
settings
|
|
76
|
+
);
|
|
69
77
|
}
|
|
70
78
|
};
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
private async *listByResourceGroupPagingPage(
|
|
74
82
|
resourceGroupName: string,
|
|
75
|
-
options?: VirtualMachineTemplatesListByResourceGroupOptionalParams
|
|
83
|
+
options?: VirtualMachineTemplatesListByResourceGroupOptionalParams,
|
|
84
|
+
settings?: PageSettings
|
|
76
85
|
): AsyncIterableIterator<VirtualMachineTemplate[]> {
|
|
77
|
-
let result
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
let result: VirtualMachineTemplatesListByResourceGroupResponse;
|
|
87
|
+
let continuationToken = settings?.continuationToken;
|
|
88
|
+
if (!continuationToken) {
|
|
89
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
|
90
|
+
let page = result.value || [];
|
|
91
|
+
continuationToken = result.nextLink;
|
|
92
|
+
setContinuationToken(page, continuationToken);
|
|
93
|
+
yield page;
|
|
94
|
+
}
|
|
80
95
|
while (continuationToken) {
|
|
81
96
|
result = await this._listByResourceGroupNext(
|
|
82
97
|
resourceGroupName,
|
|
@@ -84,7 +99,9 @@ export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates {
|
|
|
84
99
|
options
|
|
85
100
|
);
|
|
86
101
|
continuationToken = result.nextLink;
|
|
87
|
-
|
|
102
|
+
let page = result.value || [];
|
|
103
|
+
setContinuationToken(page, continuationToken);
|
|
104
|
+
yield page;
|
|
88
105
|
}
|
|
89
106
|
}
|
|
90
107
|
|
|
@@ -115,22 +132,34 @@ export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates {
|
|
|
115
132
|
[Symbol.asyncIterator]() {
|
|
116
133
|
return this;
|
|
117
134
|
},
|
|
118
|
-
byPage: () => {
|
|
119
|
-
|
|
135
|
+
byPage: (settings?: PageSettings) => {
|
|
136
|
+
if (settings?.maxPageSize) {
|
|
137
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
138
|
+
}
|
|
139
|
+
return this.listBySubscriptionPagingPage(options, settings);
|
|
120
140
|
}
|
|
121
141
|
};
|
|
122
142
|
}
|
|
123
143
|
|
|
124
144
|
private async *listBySubscriptionPagingPage(
|
|
125
|
-
options?: VirtualMachineTemplatesListBySubscriptionOptionalParams
|
|
145
|
+
options?: VirtualMachineTemplatesListBySubscriptionOptionalParams,
|
|
146
|
+
settings?: PageSettings
|
|
126
147
|
): AsyncIterableIterator<VirtualMachineTemplate[]> {
|
|
127
|
-
let result
|
|
128
|
-
|
|
129
|
-
|
|
148
|
+
let result: VirtualMachineTemplatesListBySubscriptionResponse;
|
|
149
|
+
let continuationToken = settings?.continuationToken;
|
|
150
|
+
if (!continuationToken) {
|
|
151
|
+
result = await this._listBySubscription(options);
|
|
152
|
+
let page = result.value || [];
|
|
153
|
+
continuationToken = result.nextLink;
|
|
154
|
+
setContinuationToken(page, continuationToken);
|
|
155
|
+
yield page;
|
|
156
|
+
}
|
|
130
157
|
while (continuationToken) {
|
|
131
158
|
result = await this._listBySubscriptionNext(continuationToken, options);
|
|
132
159
|
continuationToken = result.nextLink;
|
|
133
|
-
|
|
160
|
+
let page = result.value || [];
|
|
161
|
+
setContinuationToken(page, continuationToken);
|
|
162
|
+
yield page;
|
|
134
163
|
}
|
|
135
164
|
}
|
|
136
165
|
|
|
@@ -651,7 +680,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
651
680
|
bodyMapper: Mappers.ErrorResponse
|
|
652
681
|
}
|
|
653
682
|
},
|
|
654
|
-
queryParameters: [Parameters.apiVersion],
|
|
655
683
|
urlParameters: [
|
|
656
684
|
Parameters.$host,
|
|
657
685
|
Parameters.subscriptionId,
|
|
@@ -672,7 +700,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
|
|
|
672
700
|
bodyMapper: Mappers.ErrorResponse
|
|
673
701
|
}
|
|
674
702
|
},
|
|
675
|
-
queryParameters: [Parameters.apiVersion],
|
|
676
703
|
urlParameters: [
|
|
677
704
|
Parameters.$host,
|
|
678
705
|
Parameters.subscriptionId,
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { VirtualMachines } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -18,8 +19,10 @@ import {
|
|
|
18
19
|
VirtualMachine,
|
|
19
20
|
VirtualMachinesListByResourceGroupNextOptionalParams,
|
|
20
21
|
VirtualMachinesListByResourceGroupOptionalParams,
|
|
22
|
+
VirtualMachinesListByResourceGroupResponse,
|
|
21
23
|
VirtualMachinesListBySubscriptionNextOptionalParams,
|
|
22
24
|
VirtualMachinesListBySubscriptionOptionalParams,
|
|
25
|
+
VirtualMachinesListBySubscriptionResponse,
|
|
23
26
|
VirtualMachinesGetOptionalParams,
|
|
24
27
|
VirtualMachinesGetResponse,
|
|
25
28
|
VirtualMachinesCreateOrUpdateOptionalParams,
|
|
@@ -34,8 +37,6 @@ import {
|
|
|
34
37
|
VirtualMachinesCreateCheckpointOptionalParams,
|
|
35
38
|
VirtualMachinesDeleteCheckpointOptionalParams,
|
|
36
39
|
VirtualMachinesRestoreCheckpointOptionalParams,
|
|
37
|
-
VirtualMachinesListByResourceGroupResponse,
|
|
38
|
-
VirtualMachinesListBySubscriptionResponse,
|
|
39
40
|
VirtualMachinesListByResourceGroupNextResponse,
|
|
40
41
|
VirtualMachinesListBySubscriptionNextResponse
|
|
41
42
|
} from "../models";
|
|
@@ -70,19 +71,33 @@ export class VirtualMachinesImpl implements VirtualMachines {
|
|
|
70
71
|
[Symbol.asyncIterator]() {
|
|
71
72
|
return this;
|
|
72
73
|
},
|
|
73
|
-
byPage: () => {
|
|
74
|
-
|
|
74
|
+
byPage: (settings?: PageSettings) => {
|
|
75
|
+
if (settings?.maxPageSize) {
|
|
76
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
77
|
+
}
|
|
78
|
+
return this.listByResourceGroupPagingPage(
|
|
79
|
+
resourceGroupName,
|
|
80
|
+
options,
|
|
81
|
+
settings
|
|
82
|
+
);
|
|
75
83
|
}
|
|
76
84
|
};
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
private async *listByResourceGroupPagingPage(
|
|
80
88
|
resourceGroupName: string,
|
|
81
|
-
options?: VirtualMachinesListByResourceGroupOptionalParams
|
|
89
|
+
options?: VirtualMachinesListByResourceGroupOptionalParams,
|
|
90
|
+
settings?: PageSettings
|
|
82
91
|
): AsyncIterableIterator<VirtualMachine[]> {
|
|
83
|
-
let result
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
let result: VirtualMachinesListByResourceGroupResponse;
|
|
93
|
+
let continuationToken = settings?.continuationToken;
|
|
94
|
+
if (!continuationToken) {
|
|
95
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
|
96
|
+
let page = result.value || [];
|
|
97
|
+
continuationToken = result.nextLink;
|
|
98
|
+
setContinuationToken(page, continuationToken);
|
|
99
|
+
yield page;
|
|
100
|
+
}
|
|
86
101
|
while (continuationToken) {
|
|
87
102
|
result = await this._listByResourceGroupNext(
|
|
88
103
|
resourceGroupName,
|
|
@@ -90,7 +105,9 @@ export class VirtualMachinesImpl implements VirtualMachines {
|
|
|
90
105
|
options
|
|
91
106
|
);
|
|
92
107
|
continuationToken = result.nextLink;
|
|
93
|
-
|
|
108
|
+
let page = result.value || [];
|
|
109
|
+
setContinuationToken(page, continuationToken);
|
|
110
|
+
yield page;
|
|
94
111
|
}
|
|
95
112
|
}
|
|
96
113
|
|
|
@@ -121,22 +138,34 @@ export class VirtualMachinesImpl implements VirtualMachines {
|
|
|
121
138
|
[Symbol.asyncIterator]() {
|
|
122
139
|
return this;
|
|
123
140
|
},
|
|
124
|
-
byPage: () => {
|
|
125
|
-
|
|
141
|
+
byPage: (settings?: PageSettings) => {
|
|
142
|
+
if (settings?.maxPageSize) {
|
|
143
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
144
|
+
}
|
|
145
|
+
return this.listBySubscriptionPagingPage(options, settings);
|
|
126
146
|
}
|
|
127
147
|
};
|
|
128
148
|
}
|
|
129
149
|
|
|
130
150
|
private async *listBySubscriptionPagingPage(
|
|
131
|
-
options?: VirtualMachinesListBySubscriptionOptionalParams
|
|
151
|
+
options?: VirtualMachinesListBySubscriptionOptionalParams,
|
|
152
|
+
settings?: PageSettings
|
|
132
153
|
): AsyncIterableIterator<VirtualMachine[]> {
|
|
133
|
-
let result
|
|
134
|
-
|
|
135
|
-
|
|
154
|
+
let result: VirtualMachinesListBySubscriptionResponse;
|
|
155
|
+
let continuationToken = settings?.continuationToken;
|
|
156
|
+
if (!continuationToken) {
|
|
157
|
+
result = await this._listBySubscription(options);
|
|
158
|
+
let page = result.value || [];
|
|
159
|
+
continuationToken = result.nextLink;
|
|
160
|
+
setContinuationToken(page, continuationToken);
|
|
161
|
+
yield page;
|
|
162
|
+
}
|
|
136
163
|
while (continuationToken) {
|
|
137
164
|
result = await this._listBySubscriptionNext(continuationToken, options);
|
|
138
165
|
continuationToken = result.nextLink;
|
|
139
|
-
|
|
166
|
+
let page = result.value || [];
|
|
167
|
+
setContinuationToken(page, continuationToken);
|
|
168
|
+
yield page;
|
|
140
169
|
}
|
|
141
170
|
}
|
|
142
171
|
|
|
@@ -1295,7 +1324,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
1295
1324
|
bodyMapper: Mappers.ErrorResponse
|
|
1296
1325
|
}
|
|
1297
1326
|
},
|
|
1298
|
-
queryParameters: [Parameters.apiVersion],
|
|
1299
1327
|
urlParameters: [
|
|
1300
1328
|
Parameters.$host,
|
|
1301
1329
|
Parameters.subscriptionId,
|
|
@@ -1316,7 +1344,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
|
|
|
1316
1344
|
bodyMapper: Mappers.ErrorResponse
|
|
1317
1345
|
}
|
|
1318
1346
|
},
|
|
1319
|
-
queryParameters: [Parameters.apiVersion],
|
|
1320
1347
|
urlParameters: [
|
|
1321
1348
|
Parameters.$host,
|
|
1322
1349
|
Parameters.subscriptionId,
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { VirtualNetworks } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -18,8 +19,10 @@ import {
|
|
|
18
19
|
VirtualNetwork,
|
|
19
20
|
VirtualNetworksListByResourceGroupNextOptionalParams,
|
|
20
21
|
VirtualNetworksListByResourceGroupOptionalParams,
|
|
22
|
+
VirtualNetworksListByResourceGroupResponse,
|
|
21
23
|
VirtualNetworksListBySubscriptionNextOptionalParams,
|
|
22
24
|
VirtualNetworksListBySubscriptionOptionalParams,
|
|
25
|
+
VirtualNetworksListBySubscriptionResponse,
|
|
23
26
|
VirtualNetworksGetOptionalParams,
|
|
24
27
|
VirtualNetworksGetResponse,
|
|
25
28
|
VirtualNetworksCreateOrUpdateOptionalParams,
|
|
@@ -28,8 +31,6 @@ import {
|
|
|
28
31
|
ResourcePatch,
|
|
29
32
|
VirtualNetworksUpdateOptionalParams,
|
|
30
33
|
VirtualNetworksUpdateResponse,
|
|
31
|
-
VirtualNetworksListByResourceGroupResponse,
|
|
32
|
-
VirtualNetworksListBySubscriptionResponse,
|
|
33
34
|
VirtualNetworksListByResourceGroupNextResponse,
|
|
34
35
|
VirtualNetworksListBySubscriptionNextResponse
|
|
35
36
|
} from "../models";
|
|
@@ -64,19 +65,33 @@ export class VirtualNetworksImpl implements VirtualNetworks {
|
|
|
64
65
|
[Symbol.asyncIterator]() {
|
|
65
66
|
return this;
|
|
66
67
|
},
|
|
67
|
-
byPage: () => {
|
|
68
|
-
|
|
68
|
+
byPage: (settings?: PageSettings) => {
|
|
69
|
+
if (settings?.maxPageSize) {
|
|
70
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
71
|
+
}
|
|
72
|
+
return this.listByResourceGroupPagingPage(
|
|
73
|
+
resourceGroupName,
|
|
74
|
+
options,
|
|
75
|
+
settings
|
|
76
|
+
);
|
|
69
77
|
}
|
|
70
78
|
};
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
private async *listByResourceGroupPagingPage(
|
|
74
82
|
resourceGroupName: string,
|
|
75
|
-
options?: VirtualNetworksListByResourceGroupOptionalParams
|
|
83
|
+
options?: VirtualNetworksListByResourceGroupOptionalParams,
|
|
84
|
+
settings?: PageSettings
|
|
76
85
|
): AsyncIterableIterator<VirtualNetwork[]> {
|
|
77
|
-
let result
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
let result: VirtualNetworksListByResourceGroupResponse;
|
|
87
|
+
let continuationToken = settings?.continuationToken;
|
|
88
|
+
if (!continuationToken) {
|
|
89
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
|
90
|
+
let page = result.value || [];
|
|
91
|
+
continuationToken = result.nextLink;
|
|
92
|
+
setContinuationToken(page, continuationToken);
|
|
93
|
+
yield page;
|
|
94
|
+
}
|
|
80
95
|
while (continuationToken) {
|
|
81
96
|
result = await this._listByResourceGroupNext(
|
|
82
97
|
resourceGroupName,
|
|
@@ -84,7 +99,9 @@ export class VirtualNetworksImpl implements VirtualNetworks {
|
|
|
84
99
|
options
|
|
85
100
|
);
|
|
86
101
|
continuationToken = result.nextLink;
|
|
87
|
-
|
|
102
|
+
let page = result.value || [];
|
|
103
|
+
setContinuationToken(page, continuationToken);
|
|
104
|
+
yield page;
|
|
88
105
|
}
|
|
89
106
|
}
|
|
90
107
|
|
|
@@ -115,22 +132,34 @@ export class VirtualNetworksImpl implements VirtualNetworks {
|
|
|
115
132
|
[Symbol.asyncIterator]() {
|
|
116
133
|
return this;
|
|
117
134
|
},
|
|
118
|
-
byPage: () => {
|
|
119
|
-
|
|
135
|
+
byPage: (settings?: PageSettings) => {
|
|
136
|
+
if (settings?.maxPageSize) {
|
|
137
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
138
|
+
}
|
|
139
|
+
return this.listBySubscriptionPagingPage(options, settings);
|
|
120
140
|
}
|
|
121
141
|
};
|
|
122
142
|
}
|
|
123
143
|
|
|
124
144
|
private async *listBySubscriptionPagingPage(
|
|
125
|
-
options?: VirtualNetworksListBySubscriptionOptionalParams
|
|
145
|
+
options?: VirtualNetworksListBySubscriptionOptionalParams,
|
|
146
|
+
settings?: PageSettings
|
|
126
147
|
): AsyncIterableIterator<VirtualNetwork[]> {
|
|
127
|
-
let result
|
|
128
|
-
|
|
129
|
-
|
|
148
|
+
let result: VirtualNetworksListBySubscriptionResponse;
|
|
149
|
+
let continuationToken = settings?.continuationToken;
|
|
150
|
+
if (!continuationToken) {
|
|
151
|
+
result = await this._listBySubscription(options);
|
|
152
|
+
let page = result.value || [];
|
|
153
|
+
continuationToken = result.nextLink;
|
|
154
|
+
setContinuationToken(page, continuationToken);
|
|
155
|
+
yield page;
|
|
156
|
+
}
|
|
130
157
|
while (continuationToken) {
|
|
131
158
|
result = await this._listBySubscriptionNext(continuationToken, options);
|
|
132
159
|
continuationToken = result.nextLink;
|
|
133
|
-
|
|
160
|
+
let page = result.value || [];
|
|
161
|
+
setContinuationToken(page, continuationToken);
|
|
162
|
+
yield page;
|
|
134
163
|
}
|
|
135
164
|
}
|
|
136
165
|
|
|
@@ -651,7 +680,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
651
680
|
bodyMapper: Mappers.ErrorResponse
|
|
652
681
|
}
|
|
653
682
|
},
|
|
654
|
-
queryParameters: [Parameters.apiVersion],
|
|
655
683
|
urlParameters: [
|
|
656
684
|
Parameters.$host,
|
|
657
685
|
Parameters.subscriptionId,
|
|
@@ -672,7 +700,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
|
|
|
672
700
|
bodyMapper: Mappers.ErrorResponse
|
|
673
701
|
}
|
|
674
702
|
},
|
|
675
|
-
queryParameters: [Parameters.apiVersion],
|
|
676
703
|
urlParameters: [
|
|
677
704
|
Parameters.$host,
|
|
678
705
|
Parameters.subscriptionId,
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { VmmServers } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -18,8 +19,10 @@ import {
|
|
|
18
19
|
VMMServer,
|
|
19
20
|
VmmServersListByResourceGroupNextOptionalParams,
|
|
20
21
|
VmmServersListByResourceGroupOptionalParams,
|
|
22
|
+
VmmServersListByResourceGroupResponse,
|
|
21
23
|
VmmServersListBySubscriptionNextOptionalParams,
|
|
22
24
|
VmmServersListBySubscriptionOptionalParams,
|
|
25
|
+
VmmServersListBySubscriptionResponse,
|
|
23
26
|
VmmServersGetOptionalParams,
|
|
24
27
|
VmmServersGetResponse,
|
|
25
28
|
VmmServersCreateOrUpdateOptionalParams,
|
|
@@ -28,8 +31,6 @@ import {
|
|
|
28
31
|
ResourcePatch,
|
|
29
32
|
VmmServersUpdateOptionalParams,
|
|
30
33
|
VmmServersUpdateResponse,
|
|
31
|
-
VmmServersListByResourceGroupResponse,
|
|
32
|
-
VmmServersListBySubscriptionResponse,
|
|
33
34
|
VmmServersListByResourceGroupNextResponse,
|
|
34
35
|
VmmServersListBySubscriptionNextResponse
|
|
35
36
|
} from "../models";
|
|
@@ -64,19 +65,33 @@ export class VmmServersImpl implements VmmServers {
|
|
|
64
65
|
[Symbol.asyncIterator]() {
|
|
65
66
|
return this;
|
|
66
67
|
},
|
|
67
|
-
byPage: () => {
|
|
68
|
-
|
|
68
|
+
byPage: (settings?: PageSettings) => {
|
|
69
|
+
if (settings?.maxPageSize) {
|
|
70
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
71
|
+
}
|
|
72
|
+
return this.listByResourceGroupPagingPage(
|
|
73
|
+
resourceGroupName,
|
|
74
|
+
options,
|
|
75
|
+
settings
|
|
76
|
+
);
|
|
69
77
|
}
|
|
70
78
|
};
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
private async *listByResourceGroupPagingPage(
|
|
74
82
|
resourceGroupName: string,
|
|
75
|
-
options?: VmmServersListByResourceGroupOptionalParams
|
|
83
|
+
options?: VmmServersListByResourceGroupOptionalParams,
|
|
84
|
+
settings?: PageSettings
|
|
76
85
|
): AsyncIterableIterator<VMMServer[]> {
|
|
77
|
-
let result
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
let result: VmmServersListByResourceGroupResponse;
|
|
87
|
+
let continuationToken = settings?.continuationToken;
|
|
88
|
+
if (!continuationToken) {
|
|
89
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
|
90
|
+
let page = result.value || [];
|
|
91
|
+
continuationToken = result.nextLink;
|
|
92
|
+
setContinuationToken(page, continuationToken);
|
|
93
|
+
yield page;
|
|
94
|
+
}
|
|
80
95
|
while (continuationToken) {
|
|
81
96
|
result = await this._listByResourceGroupNext(
|
|
82
97
|
resourceGroupName,
|
|
@@ -84,7 +99,9 @@ export class VmmServersImpl implements VmmServers {
|
|
|
84
99
|
options
|
|
85
100
|
);
|
|
86
101
|
continuationToken = result.nextLink;
|
|
87
|
-
|
|
102
|
+
let page = result.value || [];
|
|
103
|
+
setContinuationToken(page, continuationToken);
|
|
104
|
+
yield page;
|
|
88
105
|
}
|
|
89
106
|
}
|
|
90
107
|
|
|
@@ -115,22 +132,34 @@ export class VmmServersImpl implements VmmServers {
|
|
|
115
132
|
[Symbol.asyncIterator]() {
|
|
116
133
|
return this;
|
|
117
134
|
},
|
|
118
|
-
byPage: () => {
|
|
119
|
-
|
|
135
|
+
byPage: (settings?: PageSettings) => {
|
|
136
|
+
if (settings?.maxPageSize) {
|
|
137
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
138
|
+
}
|
|
139
|
+
return this.listBySubscriptionPagingPage(options, settings);
|
|
120
140
|
}
|
|
121
141
|
};
|
|
122
142
|
}
|
|
123
143
|
|
|
124
144
|
private async *listBySubscriptionPagingPage(
|
|
125
|
-
options?: VmmServersListBySubscriptionOptionalParams
|
|
145
|
+
options?: VmmServersListBySubscriptionOptionalParams,
|
|
146
|
+
settings?: PageSettings
|
|
126
147
|
): AsyncIterableIterator<VMMServer[]> {
|
|
127
|
-
let result
|
|
128
|
-
|
|
129
|
-
|
|
148
|
+
let result: VmmServersListBySubscriptionResponse;
|
|
149
|
+
let continuationToken = settings?.continuationToken;
|
|
150
|
+
if (!continuationToken) {
|
|
151
|
+
result = await this._listBySubscription(options);
|
|
152
|
+
let page = result.value || [];
|
|
153
|
+
continuationToken = result.nextLink;
|
|
154
|
+
setContinuationToken(page, continuationToken);
|
|
155
|
+
yield page;
|
|
156
|
+
}
|
|
130
157
|
while (continuationToken) {
|
|
131
158
|
result = await this._listBySubscriptionNext(continuationToken, options);
|
|
132
159
|
continuationToken = result.nextLink;
|
|
133
|
-
|
|
160
|
+
let page = result.value || [];
|
|
161
|
+
setContinuationToken(page, continuationToken);
|
|
162
|
+
yield page;
|
|
134
163
|
}
|
|
135
164
|
}
|
|
136
165
|
|
|
@@ -650,7 +679,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
650
679
|
bodyMapper: Mappers.ErrorResponse
|
|
651
680
|
}
|
|
652
681
|
},
|
|
653
|
-
queryParameters: [Parameters.apiVersion],
|
|
654
682
|
urlParameters: [
|
|
655
683
|
Parameters.$host,
|
|
656
684
|
Parameters.subscriptionId,
|
|
@@ -671,7 +699,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
|
|
|
671
699
|
bodyMapper: Mappers.ErrorResponse
|
|
672
700
|
}
|
|
673
701
|
},
|
|
674
|
-
queryParameters: [Parameters.apiVersion],
|
|
675
702
|
urlParameters: [
|
|
676
703
|
Parameters.$host,
|
|
677
704
|
Parameters.subscriptionId,
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
export interface PageInfo {
|
|
10
|
+
continuationToken?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const pageMap = new WeakMap<object, PageInfo>();
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Given the last `.value` produced by the `byPage` iterator,
|
|
17
|
+
* returns a continuation token that can be used to begin paging from
|
|
18
|
+
* that point later.
|
|
19
|
+
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
|
20
|
+
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
21
|
+
*/
|
|
22
|
+
export function getContinuationToken(page: unknown): string | undefined {
|
|
23
|
+
if (typeof page !== "object" || page === null) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
return pageMap.get(page)?.continuationToken;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function setContinuationToken(
|
|
30
|
+
page: unknown,
|
|
31
|
+
continuationToken: string | undefined
|
|
32
|
+
): void {
|
|
33
|
+
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const pageInfo = pageMap.get(page) ?? {};
|
|
37
|
+
pageInfo.continuationToken = continuationToken;
|
|
38
|
+
pageMap.set(page, pageInfo);
|
|
39
|
+
}
|