@azure/arm-sqlvirtualmachine 5.0.0-beta.7 → 5.0.0-beta.8
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 +2 -2
- package/dist/index.js +903 -244
- 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/availabilityGroupListenersCreateOrUpdateSample.js +2 -2
- package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.js +1 -1
- package/dist-esm/samples-dev/availabilityGroupListenersGetSample.js +1 -1
- package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js +13 -6
- package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +13 -6
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.js +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.js +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.js +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js +13 -6
- package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js +13 -6
- package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js.map +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.js +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.d.ts +2 -0
- package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.js +45 -0
- package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.js.map +1 -0
- package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js +9 -6
- package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.js +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.js +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js +13 -6
- package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js +13 -6
- package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js +13 -6
- package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js.map +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.js +5 -5
- package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js +5 -5
- package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js.map +1 -1
- package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.js +1 -1
- package/dist-esm/src/lroImpl.d.ts +6 -11
- package/dist-esm/src/lroImpl.d.ts.map +1 -1
- package/dist-esm/src/lroImpl.js +12 -20
- package/dist-esm/src/lroImpl.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +234 -68
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +8 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts +14 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +325 -0
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/models/parameters.d.ts +1 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -1
- package/dist-esm/src/models/parameters.js +11 -2
- package/dist-esm/src/models/parameters.js.map +1 -1
- package/dist-esm/src/operations/availabilityGroupListeners.d.ts +3 -3
- package/dist-esm/src/operations/availabilityGroupListeners.d.ts.map +1 -1
- package/dist-esm/src/operations/availabilityGroupListeners.js +67 -33
- package/dist-esm/src/operations/availabilityGroupListeners.js.map +1 -1
- package/dist-esm/src/operations/index.d.ts +1 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -1
- package/dist-esm/src/operations/index.js +1 -0
- package/dist-esm/src/operations/index.js.map +1 -1
- package/dist-esm/src/operations/operations.js +18 -7
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts +4 -4
- package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts.map +1 -1
- package/dist-esm/src/operations/sqlVirtualMachineGroups.js +97 -35
- package/dist-esm/src/operations/sqlVirtualMachineGroups.js.map +1 -1
- package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.d.ts +32 -0
- package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.d.ts.map +1 -0
- package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.js +118 -0
- package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.js.map +1 -0
- package/dist-esm/src/operations/sqlVirtualMachines.d.ts +29 -29
- package/dist-esm/src/operations/sqlVirtualMachines.d.ts.map +1 -1
- package/dist-esm/src/operations/sqlVirtualMachines.js +215 -124
- package/dist-esm/src/operations/sqlVirtualMachines.js.map +1 -1
- package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.d.ts +3 -3
- package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/index.d.ts +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/index.js +1 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
- package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.d.ts +4 -4
- package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts +24 -0
- package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.js +9 -0
- package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts +26 -26
- package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts.map +1 -1
- package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts +2 -1
- package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts.map +1 -1
- package/dist-esm/src/sqlVirtualMachineManagementClient.js +4 -3
- package/dist-esm/src/sqlVirtualMachineManagementClient.js.map +1 -1
- package/dist-esm/test/sqlvirtualmachine_operations_test.spec.d.ts +4 -0
- package/dist-esm/test/sqlvirtualmachine_operations_test.spec.d.ts.map +1 -0
- package/dist-esm/test/sqlvirtualmachine_operations_test.spec.js +78 -0
- package/dist-esm/test/sqlvirtualmachine_operations_test.spec.js.map +1 -0
- package/package.json +10 -10
- package/review/arm-sqlvirtualmachine.api.md +131 -13
- package/src/lroImpl.ts +31 -23
- package/src/models/index.ts +210 -25
- package/src/models/mappers.ts +340 -0
- package/src/models/parameters.ts +15 -2
- package/src/operations/availabilityGroupListeners.ts +54 -28
- package/src/operations/index.ts +1 -0
- package/src/operations/operations.ts +6 -2
- package/src/operations/sqlVirtualMachineGroups.ts +88 -42
- package/src/operations/sqlVirtualMachineTroubleshoot.ts +172 -0
- package/src/operations/sqlVirtualMachines.ts +241 -181
- package/src/operationsInterfaces/availabilityGroupListeners.ts +4 -4
- package/src/operationsInterfaces/index.ts +1 -0
- package/src/operationsInterfaces/sqlVirtualMachineGroups.ts +6 -6
- package/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.ts +51 -0
- package/src/operationsInterfaces/sqlVirtualMachines.ts +57 -57
- package/src/sqlVirtualMachineManagementClient.ts +10 -4
- package/types/arm-sqlvirtualmachine.d.ts +245 -38
- package/types/tsdoc-metadata.json +1 -1
- 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
package/src/models/parameters.ts
CHANGED
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
SqlVirtualMachineGroup as SqlVirtualMachineGroupMapper,
|
|
17
17
|
SqlVirtualMachineGroupUpdate as SqlVirtualMachineGroupUpdateMapper,
|
|
18
18
|
SqlVirtualMachine as SqlVirtualMachineMapper,
|
|
19
|
-
SqlVirtualMachineUpdate as SqlVirtualMachineUpdateMapper
|
|
19
|
+
SqlVirtualMachineUpdate as SqlVirtualMachineUpdateMapper,
|
|
20
|
+
SqlVmTroubleshooting as SqlVmTroubleshootingMapper
|
|
20
21
|
} from "../models/mappers";
|
|
21
22
|
|
|
22
23
|
export const accept: OperationParameter = {
|
|
@@ -100,7 +101,7 @@ export const subscriptionId: OperationURLParameter = {
|
|
|
100
101
|
export const apiVersion: OperationQueryParameter = {
|
|
101
102
|
parameterPath: "apiVersion",
|
|
102
103
|
mapper: {
|
|
103
|
-
defaultValue: "2022-
|
|
104
|
+
defaultValue: "2022-08-01-preview",
|
|
104
105
|
isConstant: true,
|
|
105
106
|
serializedName: "api-version",
|
|
106
107
|
type: {
|
|
@@ -151,6 +152,13 @@ export const parameters2: OperationParameter = {
|
|
|
151
152
|
export const sqlVirtualMachineName: OperationURLParameter = {
|
|
152
153
|
parameterPath: "sqlVirtualMachineName",
|
|
153
154
|
mapper: {
|
|
155
|
+
constraints: {
|
|
156
|
+
Pattern: new RegExp(
|
|
157
|
+
"^((?!_)[^\\\\/\"'\\[\\]:|<>+=;,?*@&]{1,64}(?<![.-]))$"
|
|
158
|
+
),
|
|
159
|
+
MaxLength: 64,
|
|
160
|
+
MinLength: 1
|
|
161
|
+
},
|
|
154
162
|
serializedName: "sqlVirtualMachineName",
|
|
155
163
|
required: true,
|
|
156
164
|
type: {
|
|
@@ -168,3 +176,8 @@ export const parameters4: OperationParameter = {
|
|
|
168
176
|
parameterPath: "parameters",
|
|
169
177
|
mapper: SqlVirtualMachineUpdateMapper
|
|
170
178
|
};
|
|
179
|
+
|
|
180
|
+
export const parameters5: OperationParameter = {
|
|
181
|
+
parameterPath: "parameters",
|
|
182
|
+
mapper: SqlVmTroubleshootingMapper
|
|
183
|
+
};
|
|
@@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
|
|
|
13
13
|
import * as Mappers from "../models/mappers";
|
|
14
14
|
import * as Parameters from "../models/parameters";
|
|
15
15
|
import { SqlVirtualMachineManagementClient } from "../sqlVirtualMachineManagementClient";
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
SimplePollerLike,
|
|
18
|
+
OperationState,
|
|
19
|
+
createHttpPoller
|
|
20
|
+
} from "@azure/core-lro";
|
|
21
|
+
import { createLroSpec } from "../lroImpl";
|
|
18
22
|
import {
|
|
19
23
|
AvailabilityGroupListener,
|
|
20
24
|
AvailabilityGroupListenersListByGroupNextOptionalParams,
|
|
@@ -168,8 +172,8 @@ export class AvailabilityGroupListenersImpl
|
|
|
168
172
|
parameters: AvailabilityGroupListener,
|
|
169
173
|
options?: AvailabilityGroupListenersCreateOrUpdateOptionalParams
|
|
170
174
|
): Promise<
|
|
171
|
-
|
|
172
|
-
|
|
175
|
+
SimplePollerLike<
|
|
176
|
+
OperationState<AvailabilityGroupListenersCreateOrUpdateResponse>,
|
|
173
177
|
AvailabilityGroupListenersCreateOrUpdateResponse
|
|
174
178
|
>
|
|
175
179
|
> {
|
|
@@ -179,7 +183,7 @@ export class AvailabilityGroupListenersImpl
|
|
|
179
183
|
): Promise<AvailabilityGroupListenersCreateOrUpdateResponse> => {
|
|
180
184
|
return this.client.sendOperationRequest(args, spec);
|
|
181
185
|
};
|
|
182
|
-
const
|
|
186
|
+
const sendOperationFn = async (
|
|
183
187
|
args: coreClient.OperationArguments,
|
|
184
188
|
spec: coreClient.OperationSpec
|
|
185
189
|
) => {
|
|
@@ -212,20 +216,24 @@ export class AvailabilityGroupListenersImpl
|
|
|
212
216
|
};
|
|
213
217
|
};
|
|
214
218
|
|
|
215
|
-
const lro =
|
|
216
|
-
|
|
217
|
-
{
|
|
219
|
+
const lro = createLroSpec({
|
|
220
|
+
sendOperationFn,
|
|
221
|
+
args: {
|
|
218
222
|
resourceGroupName,
|
|
219
223
|
sqlVirtualMachineGroupName,
|
|
220
224
|
availabilityGroupListenerName,
|
|
221
225
|
parameters,
|
|
222
226
|
options
|
|
223
227
|
},
|
|
224
|
-
createOrUpdateOperationSpec
|
|
225
|
-
);
|
|
226
|
-
const poller =
|
|
227
|
-
|
|
228
|
-
|
|
228
|
+
spec: createOrUpdateOperationSpec
|
|
229
|
+
});
|
|
230
|
+
const poller = await createHttpPoller<
|
|
231
|
+
AvailabilityGroupListenersCreateOrUpdateResponse,
|
|
232
|
+
OperationState<AvailabilityGroupListenersCreateOrUpdateResponse>
|
|
233
|
+
>(lro, {
|
|
234
|
+
restoreFrom: options?.resumeFrom,
|
|
235
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
236
|
+
resourceLocationConfig: "azure-async-operation"
|
|
229
237
|
});
|
|
230
238
|
await poller.poll();
|
|
231
239
|
return poller;
|
|
@@ -270,14 +278,14 @@ export class AvailabilityGroupListenersImpl
|
|
|
270
278
|
sqlVirtualMachineGroupName: string,
|
|
271
279
|
availabilityGroupListenerName: string,
|
|
272
280
|
options?: AvailabilityGroupListenersDeleteOptionalParams
|
|
273
|
-
): Promise<
|
|
281
|
+
): Promise<SimplePollerLike<OperationState<void>, void>> {
|
|
274
282
|
const directSendOperation = async (
|
|
275
283
|
args: coreClient.OperationArguments,
|
|
276
284
|
spec: coreClient.OperationSpec
|
|
277
285
|
): Promise<void> => {
|
|
278
286
|
return this.client.sendOperationRequest(args, spec);
|
|
279
287
|
};
|
|
280
|
-
const
|
|
288
|
+
const sendOperationFn = async (
|
|
281
289
|
args: coreClient.OperationArguments,
|
|
282
290
|
spec: coreClient.OperationSpec
|
|
283
291
|
) => {
|
|
@@ -310,19 +318,20 @@ export class AvailabilityGroupListenersImpl
|
|
|
310
318
|
};
|
|
311
319
|
};
|
|
312
320
|
|
|
313
|
-
const lro =
|
|
314
|
-
|
|
315
|
-
{
|
|
321
|
+
const lro = createLroSpec({
|
|
322
|
+
sendOperationFn,
|
|
323
|
+
args: {
|
|
316
324
|
resourceGroupName,
|
|
317
325
|
sqlVirtualMachineGroupName,
|
|
318
326
|
availabilityGroupListenerName,
|
|
319
327
|
options
|
|
320
328
|
},
|
|
321
|
-
deleteOperationSpec
|
|
322
|
-
);
|
|
323
|
-
const poller =
|
|
324
|
-
|
|
325
|
-
intervalInMs: options?.updateIntervalInMs
|
|
329
|
+
spec: deleteOperationSpec
|
|
330
|
+
});
|
|
331
|
+
const poller = await createHttpPoller<void, OperationState<void>>(lro, {
|
|
332
|
+
restoreFrom: options?.resumeFrom,
|
|
333
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
334
|
+
resourceLocationConfig: "location"
|
|
326
335
|
});
|
|
327
336
|
await poller.poll();
|
|
328
337
|
return poller;
|
|
@@ -400,7 +409,9 @@ const getOperationSpec: coreClient.OperationSpec = {
|
|
|
400
409
|
200: {
|
|
401
410
|
bodyMapper: Mappers.AvailabilityGroupListener
|
|
402
411
|
},
|
|
403
|
-
default: {
|
|
412
|
+
default: {
|
|
413
|
+
bodyMapper: Mappers.ErrorResponse
|
|
414
|
+
}
|
|
404
415
|
},
|
|
405
416
|
queryParameters: [Parameters.expand, Parameters.apiVersion],
|
|
406
417
|
urlParameters: [
|
|
@@ -430,7 +441,9 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
|
|
430
441
|
204: {
|
|
431
442
|
bodyMapper: Mappers.AvailabilityGroupListener
|
|
432
443
|
},
|
|
433
|
-
default: {
|
|
444
|
+
default: {
|
|
445
|
+
bodyMapper: Mappers.ErrorResponse
|
|
446
|
+
}
|
|
434
447
|
},
|
|
435
448
|
requestBody: Parameters.parameters,
|
|
436
449
|
queryParameters: [Parameters.apiVersion],
|
|
@@ -449,7 +462,15 @@ const deleteOperationSpec: coreClient.OperationSpec = {
|
|
|
449
462
|
path:
|
|
450
463
|
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners/{availabilityGroupListenerName}",
|
|
451
464
|
httpMethod: "DELETE",
|
|
452
|
-
responses: {
|
|
465
|
+
responses: {
|
|
466
|
+
200: {},
|
|
467
|
+
201: {},
|
|
468
|
+
202: {},
|
|
469
|
+
204: {},
|
|
470
|
+
default: {
|
|
471
|
+
bodyMapper: Mappers.ErrorResponse
|
|
472
|
+
}
|
|
473
|
+
},
|
|
453
474
|
queryParameters: [Parameters.apiVersion],
|
|
454
475
|
urlParameters: [
|
|
455
476
|
Parameters.$host,
|
|
@@ -458,6 +479,7 @@ const deleteOperationSpec: coreClient.OperationSpec = {
|
|
|
458
479
|
Parameters.availabilityGroupListenerName,
|
|
459
480
|
Parameters.subscriptionId
|
|
460
481
|
],
|
|
482
|
+
headerParameters: [Parameters.accept],
|
|
461
483
|
serializer
|
|
462
484
|
};
|
|
463
485
|
const listByGroupOperationSpec: coreClient.OperationSpec = {
|
|
@@ -468,7 +490,9 @@ const listByGroupOperationSpec: coreClient.OperationSpec = {
|
|
|
468
490
|
200: {
|
|
469
491
|
bodyMapper: Mappers.AvailabilityGroupListenerListResult
|
|
470
492
|
},
|
|
471
|
-
default: {
|
|
493
|
+
default: {
|
|
494
|
+
bodyMapper: Mappers.ErrorResponse
|
|
495
|
+
}
|
|
472
496
|
},
|
|
473
497
|
queryParameters: [Parameters.apiVersion],
|
|
474
498
|
urlParameters: [
|
|
@@ -487,7 +511,9 @@ const listByGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
487
511
|
200: {
|
|
488
512
|
bodyMapper: Mappers.AvailabilityGroupListenerListResult
|
|
489
513
|
},
|
|
490
|
-
default: {
|
|
514
|
+
default: {
|
|
515
|
+
bodyMapper: Mappers.ErrorResponse
|
|
516
|
+
}
|
|
491
517
|
},
|
|
492
518
|
urlParameters: [
|
|
493
519
|
Parameters.$host,
|
package/src/operations/index.ts
CHANGED
|
@@ -123,7 +123,9 @@ const listOperationSpec: coreClient.OperationSpec = {
|
|
|
123
123
|
200: {
|
|
124
124
|
bodyMapper: Mappers.OperationListResult
|
|
125
125
|
},
|
|
126
|
-
default: {
|
|
126
|
+
default: {
|
|
127
|
+
bodyMapper: Mappers.ErrorResponse
|
|
128
|
+
}
|
|
127
129
|
},
|
|
128
130
|
queryParameters: [Parameters.apiVersion],
|
|
129
131
|
urlParameters: [Parameters.$host],
|
|
@@ -137,7 +139,9 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
137
139
|
200: {
|
|
138
140
|
bodyMapper: Mappers.OperationListResult
|
|
139
141
|
},
|
|
140
|
-
default: {
|
|
142
|
+
default: {
|
|
143
|
+
bodyMapper: Mappers.ErrorResponse
|
|
144
|
+
}
|
|
141
145
|
},
|
|
142
146
|
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
143
147
|
headerParameters: [Parameters.accept],
|
|
@@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
|
|
|
13
13
|
import * as Mappers from "../models/mappers";
|
|
14
14
|
import * as Parameters from "../models/parameters";
|
|
15
15
|
import { SqlVirtualMachineManagementClient } from "../sqlVirtualMachineManagementClient";
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
SimplePollerLike,
|
|
18
|
+
OperationState,
|
|
19
|
+
createHttpPoller
|
|
20
|
+
} from "@azure/core-lro";
|
|
21
|
+
import { createLroSpec } from "../lroImpl";
|
|
18
22
|
import {
|
|
19
23
|
SqlVirtualMachineGroup,
|
|
20
24
|
SqlVirtualMachineGroupsListByResourceGroupNextOptionalParams,
|
|
@@ -204,8 +208,8 @@ export class SqlVirtualMachineGroupsImpl implements SqlVirtualMachineGroups {
|
|
|
204
208
|
parameters: SqlVirtualMachineGroup,
|
|
205
209
|
options?: SqlVirtualMachineGroupsCreateOrUpdateOptionalParams
|
|
206
210
|
): Promise<
|
|
207
|
-
|
|
208
|
-
|
|
211
|
+
SimplePollerLike<
|
|
212
|
+
OperationState<SqlVirtualMachineGroupsCreateOrUpdateResponse>,
|
|
209
213
|
SqlVirtualMachineGroupsCreateOrUpdateResponse
|
|
210
214
|
>
|
|
211
215
|
> {
|
|
@@ -215,7 +219,7 @@ export class SqlVirtualMachineGroupsImpl implements SqlVirtualMachineGroups {
|
|
|
215
219
|
): Promise<SqlVirtualMachineGroupsCreateOrUpdateResponse> => {
|
|
216
220
|
return this.client.sendOperationRequest(args, spec);
|
|
217
221
|
};
|
|
218
|
-
const
|
|
222
|
+
const sendOperationFn = async (
|
|
219
223
|
args: coreClient.OperationArguments,
|
|
220
224
|
spec: coreClient.OperationSpec
|
|
221
225
|
) => {
|
|
@@ -248,14 +252,23 @@ export class SqlVirtualMachineGroupsImpl implements SqlVirtualMachineGroups {
|
|
|
248
252
|
};
|
|
249
253
|
};
|
|
250
254
|
|
|
251
|
-
const lro =
|
|
252
|
-
|
|
253
|
-
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
const lro = createLroSpec({
|
|
256
|
+
sendOperationFn,
|
|
257
|
+
args: {
|
|
258
|
+
resourceGroupName,
|
|
259
|
+
sqlVirtualMachineGroupName,
|
|
260
|
+
parameters,
|
|
261
|
+
options
|
|
262
|
+
},
|
|
263
|
+
spec: createOrUpdateOperationSpec
|
|
264
|
+
});
|
|
265
|
+
const poller = await createHttpPoller<
|
|
266
|
+
SqlVirtualMachineGroupsCreateOrUpdateResponse,
|
|
267
|
+
OperationState<SqlVirtualMachineGroupsCreateOrUpdateResponse>
|
|
268
|
+
>(lro, {
|
|
269
|
+
restoreFrom: options?.resumeFrom,
|
|
270
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
271
|
+
resourceLocationConfig: "azure-async-operation"
|
|
259
272
|
});
|
|
260
273
|
await poller.poll();
|
|
261
274
|
return poller;
|
|
@@ -295,14 +308,14 @@ export class SqlVirtualMachineGroupsImpl implements SqlVirtualMachineGroups {
|
|
|
295
308
|
resourceGroupName: string,
|
|
296
309
|
sqlVirtualMachineGroupName: string,
|
|
297
310
|
options?: SqlVirtualMachineGroupsDeleteOptionalParams
|
|
298
|
-
): Promise<
|
|
311
|
+
): Promise<SimplePollerLike<OperationState<void>, void>> {
|
|
299
312
|
const directSendOperation = async (
|
|
300
313
|
args: coreClient.OperationArguments,
|
|
301
314
|
spec: coreClient.OperationSpec
|
|
302
315
|
): Promise<void> => {
|
|
303
316
|
return this.client.sendOperationRequest(args, spec);
|
|
304
317
|
};
|
|
305
|
-
const
|
|
318
|
+
const sendOperationFn = async (
|
|
306
319
|
args: coreClient.OperationArguments,
|
|
307
320
|
spec: coreClient.OperationSpec
|
|
308
321
|
) => {
|
|
@@ -335,14 +348,15 @@ export class SqlVirtualMachineGroupsImpl implements SqlVirtualMachineGroups {
|
|
|
335
348
|
};
|
|
336
349
|
};
|
|
337
350
|
|
|
338
|
-
const lro =
|
|
339
|
-
|
|
340
|
-
{ resourceGroupName, sqlVirtualMachineGroupName, options },
|
|
341
|
-
deleteOperationSpec
|
|
342
|
-
);
|
|
343
|
-
const poller =
|
|
344
|
-
|
|
345
|
-
intervalInMs: options?.updateIntervalInMs
|
|
351
|
+
const lro = createLroSpec({
|
|
352
|
+
sendOperationFn,
|
|
353
|
+
args: { resourceGroupName, sqlVirtualMachineGroupName, options },
|
|
354
|
+
spec: deleteOperationSpec
|
|
355
|
+
});
|
|
356
|
+
const poller = await createHttpPoller<void, OperationState<void>>(lro, {
|
|
357
|
+
restoreFrom: options?.resumeFrom,
|
|
358
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
359
|
+
resourceLocationConfig: "location"
|
|
346
360
|
});
|
|
347
361
|
await poller.poll();
|
|
348
362
|
return poller;
|
|
@@ -382,8 +396,8 @@ export class SqlVirtualMachineGroupsImpl implements SqlVirtualMachineGroups {
|
|
|
382
396
|
parameters: SqlVirtualMachineGroupUpdate,
|
|
383
397
|
options?: SqlVirtualMachineGroupsUpdateOptionalParams
|
|
384
398
|
): Promise<
|
|
385
|
-
|
|
386
|
-
|
|
399
|
+
SimplePollerLike<
|
|
400
|
+
OperationState<SqlVirtualMachineGroupsUpdateResponse>,
|
|
387
401
|
SqlVirtualMachineGroupsUpdateResponse
|
|
388
402
|
>
|
|
389
403
|
> {
|
|
@@ -393,7 +407,7 @@ export class SqlVirtualMachineGroupsImpl implements SqlVirtualMachineGroups {
|
|
|
393
407
|
): Promise<SqlVirtualMachineGroupsUpdateResponse> => {
|
|
394
408
|
return this.client.sendOperationRequest(args, spec);
|
|
395
409
|
};
|
|
396
|
-
const
|
|
410
|
+
const sendOperationFn = async (
|
|
397
411
|
args: coreClient.OperationArguments,
|
|
398
412
|
spec: coreClient.OperationSpec
|
|
399
413
|
) => {
|
|
@@ -426,14 +440,23 @@ export class SqlVirtualMachineGroupsImpl implements SqlVirtualMachineGroups {
|
|
|
426
440
|
};
|
|
427
441
|
};
|
|
428
442
|
|
|
429
|
-
const lro =
|
|
430
|
-
|
|
431
|
-
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
443
|
+
const lro = createLroSpec({
|
|
444
|
+
sendOperationFn,
|
|
445
|
+
args: {
|
|
446
|
+
resourceGroupName,
|
|
447
|
+
sqlVirtualMachineGroupName,
|
|
448
|
+
parameters,
|
|
449
|
+
options
|
|
450
|
+
},
|
|
451
|
+
spec: updateOperationSpec
|
|
452
|
+
});
|
|
453
|
+
const poller = await createHttpPoller<
|
|
454
|
+
SqlVirtualMachineGroupsUpdateResponse,
|
|
455
|
+
OperationState<SqlVirtualMachineGroupsUpdateResponse>
|
|
456
|
+
>(lro, {
|
|
457
|
+
restoreFrom: options?.resumeFrom,
|
|
458
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
459
|
+
resourceLocationConfig: "azure-async-operation"
|
|
437
460
|
});
|
|
438
461
|
await poller.poll();
|
|
439
462
|
return poller;
|
|
@@ -532,7 +555,9 @@ const getOperationSpec: coreClient.OperationSpec = {
|
|
|
532
555
|
200: {
|
|
533
556
|
bodyMapper: Mappers.SqlVirtualMachineGroup
|
|
534
557
|
},
|
|
535
|
-
default: {
|
|
558
|
+
default: {
|
|
559
|
+
bodyMapper: Mappers.ErrorResponse
|
|
560
|
+
}
|
|
536
561
|
},
|
|
537
562
|
queryParameters: [Parameters.apiVersion],
|
|
538
563
|
urlParameters: [
|
|
@@ -561,7 +586,9 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
|
|
561
586
|
204: {
|
|
562
587
|
bodyMapper: Mappers.SqlVirtualMachineGroup
|
|
563
588
|
},
|
|
564
|
-
default: {
|
|
589
|
+
default: {
|
|
590
|
+
bodyMapper: Mappers.ErrorResponse
|
|
591
|
+
}
|
|
565
592
|
},
|
|
566
593
|
requestBody: Parameters.parameters1,
|
|
567
594
|
queryParameters: [Parameters.apiVersion],
|
|
@@ -579,7 +606,15 @@ const deleteOperationSpec: coreClient.OperationSpec = {
|
|
|
579
606
|
path:
|
|
580
607
|
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}",
|
|
581
608
|
httpMethod: "DELETE",
|
|
582
|
-
responses: {
|
|
609
|
+
responses: {
|
|
610
|
+
200: {},
|
|
611
|
+
201: {},
|
|
612
|
+
202: {},
|
|
613
|
+
204: {},
|
|
614
|
+
default: {
|
|
615
|
+
bodyMapper: Mappers.ErrorResponse
|
|
616
|
+
}
|
|
617
|
+
},
|
|
583
618
|
queryParameters: [Parameters.apiVersion],
|
|
584
619
|
urlParameters: [
|
|
585
620
|
Parameters.$host,
|
|
@@ -587,6 +622,7 @@ const deleteOperationSpec: coreClient.OperationSpec = {
|
|
|
587
622
|
Parameters.sqlVirtualMachineGroupName,
|
|
588
623
|
Parameters.subscriptionId
|
|
589
624
|
],
|
|
625
|
+
headerParameters: [Parameters.accept],
|
|
590
626
|
serializer
|
|
591
627
|
};
|
|
592
628
|
const updateOperationSpec: coreClient.OperationSpec = {
|
|
@@ -606,7 +642,9 @@ const updateOperationSpec: coreClient.OperationSpec = {
|
|
|
606
642
|
204: {
|
|
607
643
|
bodyMapper: Mappers.SqlVirtualMachineGroup
|
|
608
644
|
},
|
|
609
|
-
default: {
|
|
645
|
+
default: {
|
|
646
|
+
bodyMapper: Mappers.ErrorResponse
|
|
647
|
+
}
|
|
610
648
|
},
|
|
611
649
|
requestBody: Parameters.parameters2,
|
|
612
650
|
queryParameters: [Parameters.apiVersion],
|
|
@@ -628,7 +666,9 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
|
|
|
628
666
|
200: {
|
|
629
667
|
bodyMapper: Mappers.SqlVirtualMachineGroupListResult
|
|
630
668
|
},
|
|
631
|
-
default: {
|
|
669
|
+
default: {
|
|
670
|
+
bodyMapper: Mappers.ErrorResponse
|
|
671
|
+
}
|
|
632
672
|
},
|
|
633
673
|
queryParameters: [Parameters.apiVersion],
|
|
634
674
|
urlParameters: [
|
|
@@ -647,7 +687,9 @@ const listOperationSpec: coreClient.OperationSpec = {
|
|
|
647
687
|
200: {
|
|
648
688
|
bodyMapper: Mappers.SqlVirtualMachineGroupListResult
|
|
649
689
|
},
|
|
650
|
-
default: {
|
|
690
|
+
default: {
|
|
691
|
+
bodyMapper: Mappers.ErrorResponse
|
|
692
|
+
}
|
|
651
693
|
},
|
|
652
694
|
queryParameters: [Parameters.apiVersion],
|
|
653
695
|
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
@@ -661,7 +703,9 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
661
703
|
200: {
|
|
662
704
|
bodyMapper: Mappers.SqlVirtualMachineGroupListResult
|
|
663
705
|
},
|
|
664
|
-
default: {
|
|
706
|
+
default: {
|
|
707
|
+
bodyMapper: Mappers.ErrorResponse
|
|
708
|
+
}
|
|
665
709
|
},
|
|
666
710
|
urlParameters: [
|
|
667
711
|
Parameters.$host,
|
|
@@ -679,7 +723,9 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
679
723
|
200: {
|
|
680
724
|
bodyMapper: Mappers.SqlVirtualMachineGroupListResult
|
|
681
725
|
},
|
|
682
|
-
default: {
|
|
726
|
+
default: {
|
|
727
|
+
bodyMapper: Mappers.ErrorResponse
|
|
728
|
+
}
|
|
683
729
|
},
|
|
684
730
|
urlParameters: [
|
|
685
731
|
Parameters.$host,
|
|
@@ -0,0 +1,172 @@
|
|
|
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 { SqlVirtualMachineTroubleshoot } from "../operationsInterfaces";
|
|
10
|
+
import * as coreClient from "@azure/core-client";
|
|
11
|
+
import * as Mappers from "../models/mappers";
|
|
12
|
+
import * as Parameters from "../models/parameters";
|
|
13
|
+
import { SqlVirtualMachineManagementClient } from "../sqlVirtualMachineManagementClient";
|
|
14
|
+
import {
|
|
15
|
+
SimplePollerLike,
|
|
16
|
+
OperationState,
|
|
17
|
+
createHttpPoller
|
|
18
|
+
} from "@azure/core-lro";
|
|
19
|
+
import { createLroSpec } from "../lroImpl";
|
|
20
|
+
import {
|
|
21
|
+
SqlVmTroubleshooting,
|
|
22
|
+
SqlVirtualMachineTroubleshootTroubleshootOptionalParams,
|
|
23
|
+
SqlVirtualMachineTroubleshootTroubleshootResponse
|
|
24
|
+
} from "../models";
|
|
25
|
+
|
|
26
|
+
/** Class containing SqlVirtualMachineTroubleshoot operations. */
|
|
27
|
+
export class SqlVirtualMachineTroubleshootImpl
|
|
28
|
+
implements SqlVirtualMachineTroubleshoot {
|
|
29
|
+
private readonly client: SqlVirtualMachineManagementClient;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Initialize a new instance of the class SqlVirtualMachineTroubleshoot class.
|
|
33
|
+
* @param client Reference to the service client
|
|
34
|
+
*/
|
|
35
|
+
constructor(client: SqlVirtualMachineManagementClient) {
|
|
36
|
+
this.client = client;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Starts SQL virtual machine troubleshooting.
|
|
41
|
+
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
|
|
42
|
+
* value from the Azure Resource Manager API or the portal.
|
|
43
|
+
* @param sqlVirtualMachineName Name of the SQL virtual machine.
|
|
44
|
+
* @param parameters The SQL virtual machine troubleshooting entity.
|
|
45
|
+
* @param options The options parameters.
|
|
46
|
+
*/
|
|
47
|
+
async beginTroubleshoot(
|
|
48
|
+
resourceGroupName: string,
|
|
49
|
+
sqlVirtualMachineName: string,
|
|
50
|
+
parameters: SqlVmTroubleshooting,
|
|
51
|
+
options?: SqlVirtualMachineTroubleshootTroubleshootOptionalParams
|
|
52
|
+
): Promise<
|
|
53
|
+
SimplePollerLike<
|
|
54
|
+
OperationState<SqlVirtualMachineTroubleshootTroubleshootResponse>,
|
|
55
|
+
SqlVirtualMachineTroubleshootTroubleshootResponse
|
|
56
|
+
>
|
|
57
|
+
> {
|
|
58
|
+
const directSendOperation = async (
|
|
59
|
+
args: coreClient.OperationArguments,
|
|
60
|
+
spec: coreClient.OperationSpec
|
|
61
|
+
): Promise<SqlVirtualMachineTroubleshootTroubleshootResponse> => {
|
|
62
|
+
return this.client.sendOperationRequest(args, spec);
|
|
63
|
+
};
|
|
64
|
+
const sendOperationFn = async (
|
|
65
|
+
args: coreClient.OperationArguments,
|
|
66
|
+
spec: coreClient.OperationSpec
|
|
67
|
+
) => {
|
|
68
|
+
let currentRawResponse:
|
|
69
|
+
| coreClient.FullOperationResponse
|
|
70
|
+
| undefined = undefined;
|
|
71
|
+
const providedCallback = args.options?.onResponse;
|
|
72
|
+
const callback: coreClient.RawResponseCallback = (
|
|
73
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
74
|
+
flatResponse: unknown
|
|
75
|
+
) => {
|
|
76
|
+
currentRawResponse = rawResponse;
|
|
77
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
78
|
+
};
|
|
79
|
+
const updatedArgs = {
|
|
80
|
+
...args,
|
|
81
|
+
options: {
|
|
82
|
+
...args.options,
|
|
83
|
+
onResponse: callback
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
87
|
+
return {
|
|
88
|
+
flatResponse,
|
|
89
|
+
rawResponse: {
|
|
90
|
+
statusCode: currentRawResponse!.status,
|
|
91
|
+
body: currentRawResponse!.parsedBody,
|
|
92
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const lro = createLroSpec({
|
|
98
|
+
sendOperationFn,
|
|
99
|
+
args: { resourceGroupName, sqlVirtualMachineName, parameters, options },
|
|
100
|
+
spec: troubleshootOperationSpec
|
|
101
|
+
});
|
|
102
|
+
const poller = await createHttpPoller<
|
|
103
|
+
SqlVirtualMachineTroubleshootTroubleshootResponse,
|
|
104
|
+
OperationState<SqlVirtualMachineTroubleshootTroubleshootResponse>
|
|
105
|
+
>(lro, {
|
|
106
|
+
restoreFrom: options?.resumeFrom,
|
|
107
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
108
|
+
resourceLocationConfig: "location"
|
|
109
|
+
});
|
|
110
|
+
await poller.poll();
|
|
111
|
+
return poller;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Starts SQL virtual machine troubleshooting.
|
|
116
|
+
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
|
|
117
|
+
* value from the Azure Resource Manager API or the portal.
|
|
118
|
+
* @param sqlVirtualMachineName Name of the SQL virtual machine.
|
|
119
|
+
* @param parameters The SQL virtual machine troubleshooting entity.
|
|
120
|
+
* @param options The options parameters.
|
|
121
|
+
*/
|
|
122
|
+
async beginTroubleshootAndWait(
|
|
123
|
+
resourceGroupName: string,
|
|
124
|
+
sqlVirtualMachineName: string,
|
|
125
|
+
parameters: SqlVmTroubleshooting,
|
|
126
|
+
options?: SqlVirtualMachineTroubleshootTroubleshootOptionalParams
|
|
127
|
+
): Promise<SqlVirtualMachineTroubleshootTroubleshootResponse> {
|
|
128
|
+
const poller = await this.beginTroubleshoot(
|
|
129
|
+
resourceGroupName,
|
|
130
|
+
sqlVirtualMachineName,
|
|
131
|
+
parameters,
|
|
132
|
+
options
|
|
133
|
+
);
|
|
134
|
+
return poller.pollUntilDone();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Operation Specifications
|
|
138
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
139
|
+
|
|
140
|
+
const troubleshootOperationSpec: coreClient.OperationSpec = {
|
|
141
|
+
path:
|
|
142
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/troubleshoot",
|
|
143
|
+
httpMethod: "POST",
|
|
144
|
+
responses: {
|
|
145
|
+
200: {
|
|
146
|
+
bodyMapper: Mappers.SqlVmTroubleshooting
|
|
147
|
+
},
|
|
148
|
+
201: {
|
|
149
|
+
bodyMapper: Mappers.SqlVmTroubleshooting
|
|
150
|
+
},
|
|
151
|
+
202: {
|
|
152
|
+
bodyMapper: Mappers.SqlVmTroubleshooting
|
|
153
|
+
},
|
|
154
|
+
204: {
|
|
155
|
+
bodyMapper: Mappers.SqlVmTroubleshooting
|
|
156
|
+
},
|
|
157
|
+
default: {
|
|
158
|
+
bodyMapper: Mappers.ErrorResponse
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
requestBody: Parameters.parameters5,
|
|
162
|
+
queryParameters: [Parameters.apiVersion],
|
|
163
|
+
urlParameters: [
|
|
164
|
+
Parameters.$host,
|
|
165
|
+
Parameters.resourceGroupName,
|
|
166
|
+
Parameters.subscriptionId,
|
|
167
|
+
Parameters.sqlVirtualMachineName
|
|
168
|
+
],
|
|
169
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
170
|
+
mediaType: "json",
|
|
171
|
+
serializer
|
|
172
|
+
};
|