@azure/arm-scvmm 1.0.0-beta.1 → 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 +22 -0
- package/LICENSE +1 -1
- package/README.md +8 -8
- package/dist/index.js +355 -131
- 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/models/index.d.ts +33 -11
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +21 -0
- package/dist-esm/src/models/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 +2 -0
- package/dist-esm/src/scvmm.d.ts.map +1 -1
- package/dist-esm/src/scvmm.js +49 -18
- package/dist-esm/src/scvmm.js.map +1 -1
- package/dist-esm/test/sampleTest.js +11 -13
- package/dist-esm/test/sampleTest.js.map +1 -1
- package/package.json +16 -11
- package/review/arm-scvmm.api.md +24 -41
- package/src/index.ts +1 -0
- package/src/models/index.ts +33 -11
- 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 +60 -20
- package/types/arm-scvmm.d.ts +44 -11
- 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 { 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
|
+
}
|
package/src/scvmm.ts
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
import * as coreClient from "@azure/core-client";
|
|
10
10
|
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
11
|
+
import {
|
|
12
|
+
PipelineRequest,
|
|
13
|
+
PipelineResponse,
|
|
14
|
+
SendRequest
|
|
15
|
+
} from "@azure/core-rest-pipeline";
|
|
11
16
|
import * as coreAuth from "@azure/core-auth";
|
|
12
17
|
import {
|
|
13
18
|
VmmServersImpl,
|
|
@@ -64,47 +69,53 @@ export class Scvmm extends coreClient.ServiceClient {
|
|
|
64
69
|
credential: credentials
|
|
65
70
|
};
|
|
66
71
|
|
|
67
|
-
const packageDetails = `azsdk-js-arm-scvmm/1.0.0-beta.
|
|
72
|
+
const packageDetails = `azsdk-js-arm-scvmm/1.0.0-beta.3`;
|
|
68
73
|
const userAgentPrefix =
|
|
69
74
|
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
70
75
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
71
76
|
: `${packageDetails}`;
|
|
72
77
|
|
|
73
|
-
if (!options.credentialScopes) {
|
|
74
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
75
|
-
}
|
|
76
78
|
const optionsWithDefaults = {
|
|
77
79
|
...defaults,
|
|
78
80
|
...options,
|
|
79
81
|
userAgentOptions: {
|
|
80
82
|
userAgentPrefix
|
|
81
83
|
},
|
|
82
|
-
|
|
84
|
+
endpoint:
|
|
83
85
|
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
84
86
|
};
|
|
85
87
|
super(optionsWithDefaults);
|
|
86
88
|
|
|
89
|
+
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
|
87
90
|
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
88
91
|
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
89
|
-
|
|
92
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
90
93
|
(pipelinePolicy) =>
|
|
91
94
|
pipelinePolicy.name ===
|
|
92
95
|
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
93
96
|
);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
97
|
+
}
|
|
98
|
+
if (
|
|
99
|
+
!options ||
|
|
100
|
+
!options.pipeline ||
|
|
101
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
102
|
+
!bearerTokenAuthenticationPolicyFound
|
|
103
|
+
) {
|
|
104
|
+
this.pipeline.removePolicy({
|
|
105
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
106
|
+
});
|
|
107
|
+
this.pipeline.addPolicy(
|
|
108
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
109
|
+
credential: credentials,
|
|
110
|
+
scopes:
|
|
111
|
+
optionsWithDefaults.credentialScopes ??
|
|
112
|
+
`${optionsWithDefaults.endpoint}/.default`,
|
|
113
|
+
challengeCallbacks: {
|
|
114
|
+
authorizeRequestOnChallenge:
|
|
115
|
+
coreClient.authorizeRequestOnClaimChallenge
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
);
|
|
108
119
|
}
|
|
109
120
|
// Parameter assignments
|
|
110
121
|
this.subscriptionId = subscriptionId;
|
|
@@ -120,6 +131,35 @@ export class Scvmm extends coreClient.ServiceClient {
|
|
|
120
131
|
this.virtualMachineTemplates = new VirtualMachineTemplatesImpl(this);
|
|
121
132
|
this.availabilitySets = new AvailabilitySetsImpl(this);
|
|
122
133
|
this.inventoryItems = new InventoryItemsImpl(this);
|
|
134
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
138
|
+
private addCustomApiVersionPolicy(apiVersion?: string) {
|
|
139
|
+
if (!apiVersion) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const apiVersionPolicy = {
|
|
143
|
+
name: "CustomApiVersionPolicy",
|
|
144
|
+
async sendRequest(
|
|
145
|
+
request: PipelineRequest,
|
|
146
|
+
next: SendRequest
|
|
147
|
+
): Promise<PipelineResponse> {
|
|
148
|
+
const param = request.url.split("?");
|
|
149
|
+
if (param.length > 1) {
|
|
150
|
+
const newParams = param[1].split("&").map((item) => {
|
|
151
|
+
if (item.indexOf("api-version") > -1) {
|
|
152
|
+
return "api-version=" + apiVersion;
|
|
153
|
+
} else {
|
|
154
|
+
return item;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
158
|
+
}
|
|
159
|
+
return next(request);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
123
163
|
}
|
|
124
164
|
|
|
125
165
|
vmmServers: VmmServers;
|