@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.
Files changed (122) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/dist/index.js +903 -244
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.js +2 -2
  7. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.js +1 -1
  8. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.js +1 -1
  9. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js +13 -6
  10. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js.map +1 -1
  11. package/dist-esm/samples-dev/operationsListSample.js +13 -6
  12. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  13. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.js +1 -1
  14. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.js +1 -1
  15. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.js +1 -1
  16. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js +13 -6
  17. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js.map +1 -1
  18. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js +13 -6
  19. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js.map +1 -1
  20. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.js +1 -1
  21. package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.d.ts +2 -0
  22. package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.d.ts.map +1 -0
  23. package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.js +45 -0
  24. package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.js.map +1 -0
  25. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js +9 -6
  26. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js.map +1 -1
  27. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.js +1 -1
  28. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.js +1 -1
  29. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js +13 -6
  30. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js.map +1 -1
  31. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js +13 -6
  32. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js.map +1 -1
  33. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js +13 -6
  34. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js.map +1 -1
  35. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.js +5 -5
  36. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js +5 -5
  37. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js.map +1 -1
  38. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.js +1 -1
  39. package/dist-esm/src/lroImpl.d.ts +6 -11
  40. package/dist-esm/src/lroImpl.d.ts.map +1 -1
  41. package/dist-esm/src/lroImpl.js +12 -20
  42. package/dist-esm/src/lroImpl.js.map +1 -1
  43. package/dist-esm/src/models/index.d.ts +234 -68
  44. package/dist-esm/src/models/index.d.ts.map +1 -1
  45. package/dist-esm/src/models/index.js +8 -0
  46. package/dist-esm/src/models/index.js.map +1 -1
  47. package/dist-esm/src/models/mappers.d.ts +14 -0
  48. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  49. package/dist-esm/src/models/mappers.js +325 -0
  50. package/dist-esm/src/models/mappers.js.map +1 -1
  51. package/dist-esm/src/models/parameters.d.ts +1 -0
  52. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  53. package/dist-esm/src/models/parameters.js +11 -2
  54. package/dist-esm/src/models/parameters.js.map +1 -1
  55. package/dist-esm/src/operations/availabilityGroupListeners.d.ts +3 -3
  56. package/dist-esm/src/operations/availabilityGroupListeners.d.ts.map +1 -1
  57. package/dist-esm/src/operations/availabilityGroupListeners.js +67 -33
  58. package/dist-esm/src/operations/availabilityGroupListeners.js.map +1 -1
  59. package/dist-esm/src/operations/index.d.ts +1 -0
  60. package/dist-esm/src/operations/index.d.ts.map +1 -1
  61. package/dist-esm/src/operations/index.js +1 -0
  62. package/dist-esm/src/operations/index.js.map +1 -1
  63. package/dist-esm/src/operations/operations.js +18 -7
  64. package/dist-esm/src/operations/operations.js.map +1 -1
  65. package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts +4 -4
  66. package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts.map +1 -1
  67. package/dist-esm/src/operations/sqlVirtualMachineGroups.js +97 -35
  68. package/dist-esm/src/operations/sqlVirtualMachineGroups.js.map +1 -1
  69. package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.d.ts +32 -0
  70. package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.d.ts.map +1 -0
  71. package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.js +118 -0
  72. package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.js.map +1 -0
  73. package/dist-esm/src/operations/sqlVirtualMachines.d.ts +29 -29
  74. package/dist-esm/src/operations/sqlVirtualMachines.d.ts.map +1 -1
  75. package/dist-esm/src/operations/sqlVirtualMachines.js +215 -124
  76. package/dist-esm/src/operations/sqlVirtualMachines.js.map +1 -1
  77. package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.d.ts +3 -3
  78. package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.d.ts.map +1 -1
  79. package/dist-esm/src/operationsInterfaces/index.d.ts +1 -0
  80. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  81. package/dist-esm/src/operationsInterfaces/index.js +1 -0
  82. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  83. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.d.ts +4 -4
  84. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.d.ts.map +1 -1
  85. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts +24 -0
  86. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts.map +1 -0
  87. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.js +9 -0
  88. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.js.map +1 -0
  89. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts +26 -26
  90. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts.map +1 -1
  91. package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts +2 -1
  92. package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts.map +1 -1
  93. package/dist-esm/src/sqlVirtualMachineManagementClient.js +4 -3
  94. package/dist-esm/src/sqlVirtualMachineManagementClient.js.map +1 -1
  95. package/dist-esm/test/sqlvirtualmachine_operations_test.spec.d.ts +4 -0
  96. package/dist-esm/test/sqlvirtualmachine_operations_test.spec.d.ts.map +1 -0
  97. package/dist-esm/test/sqlvirtualmachine_operations_test.spec.js +78 -0
  98. package/dist-esm/test/sqlvirtualmachine_operations_test.spec.js.map +1 -0
  99. package/package.json +10 -10
  100. package/review/arm-sqlvirtualmachine.api.md +131 -13
  101. package/src/lroImpl.ts +31 -23
  102. package/src/models/index.ts +210 -25
  103. package/src/models/mappers.ts +340 -0
  104. package/src/models/parameters.ts +15 -2
  105. package/src/operations/availabilityGroupListeners.ts +54 -28
  106. package/src/operations/index.ts +1 -0
  107. package/src/operations/operations.ts +6 -2
  108. package/src/operations/sqlVirtualMachineGroups.ts +88 -42
  109. package/src/operations/sqlVirtualMachineTroubleshoot.ts +172 -0
  110. package/src/operations/sqlVirtualMachines.ts +241 -181
  111. package/src/operationsInterfaces/availabilityGroupListeners.ts +4 -4
  112. package/src/operationsInterfaces/index.ts +1 -0
  113. package/src/operationsInterfaces/sqlVirtualMachineGroups.ts +6 -6
  114. package/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.ts +51 -0
  115. package/src/operationsInterfaces/sqlVirtualMachines.ts +57 -57
  116. package/src/sqlVirtualMachineManagementClient.ts +10 -4
  117. package/types/arm-sqlvirtualmachine.d.ts +245 -38
  118. package/types/tsdoc-metadata.json +1 -1
  119. package/dist-esm/test/sampleTest.d.ts +0 -2
  120. package/dist-esm/test/sampleTest.d.ts.map +0 -1
  121. package/dist-esm/test/sampleTest.js +0 -38
  122. package/dist-esm/test/sampleTest.js.map +0 -1
@@ -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 { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
17
- import { LroImpl } from "../lroImpl";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
18
22
  import {
19
23
  SqlVirtualMachine,
20
24
  SqlVirtualMachinesListBySqlVmGroupNextOptionalParams,
@@ -26,8 +30,6 @@ import {
26
30
  SqlVirtualMachinesListByResourceGroupNextOptionalParams,
27
31
  SqlVirtualMachinesListByResourceGroupOptionalParams,
28
32
  SqlVirtualMachinesListByResourceGroupResponse,
29
- SqlVirtualMachinesStartAssessmentOptionalParams,
30
- SqlVirtualMachinesRedeployOptionalParams,
31
33
  SqlVirtualMachinesGetOptionalParams,
32
34
  SqlVirtualMachinesGetResponse,
33
35
  SqlVirtualMachinesCreateOrUpdateOptionalParams,
@@ -36,6 +38,8 @@ import {
36
38
  SqlVirtualMachineUpdate,
37
39
  SqlVirtualMachinesUpdateOptionalParams,
38
40
  SqlVirtualMachinesUpdateResponse,
41
+ SqlVirtualMachinesStartAssessmentOptionalParams,
42
+ SqlVirtualMachinesRedeployOptionalParams,
39
43
  SqlVirtualMachinesListBySqlVmGroupNextResponse,
40
44
  SqlVirtualMachinesListNextResponse,
41
45
  SqlVirtualMachinesListByResourceGroupNextResponse
@@ -292,24 +296,49 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
292
296
  }
293
297
 
294
298
  /**
295
- * Starts Assessment on SQL virtual machine.
299
+ * Gets a SQL virtual machine.
296
300
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
297
301
  * value from the Azure Resource Manager API or the portal.
298
302
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
299
303
  * @param options The options parameters.
300
304
  */
301
- async beginStartAssessment(
305
+ get(
302
306
  resourceGroupName: string,
303
307
  sqlVirtualMachineName: string,
304
- options?: SqlVirtualMachinesStartAssessmentOptionalParams
305
- ): Promise<PollerLike<PollOperationState<void>, void>> {
308
+ options?: SqlVirtualMachinesGetOptionalParams
309
+ ): Promise<SqlVirtualMachinesGetResponse> {
310
+ return this.client.sendOperationRequest(
311
+ { resourceGroupName, sqlVirtualMachineName, options },
312
+ getOperationSpec
313
+ );
314
+ }
315
+
316
+ /**
317
+ * Creates or updates a SQL virtual machine.
318
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
319
+ * value from the Azure Resource Manager API or the portal.
320
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
321
+ * @param parameters The SQL virtual machine.
322
+ * @param options The options parameters.
323
+ */
324
+ async beginCreateOrUpdate(
325
+ resourceGroupName: string,
326
+ sqlVirtualMachineName: string,
327
+ parameters: SqlVirtualMachine,
328
+ options?: SqlVirtualMachinesCreateOrUpdateOptionalParams
329
+ ): Promise<
330
+ SimplePollerLike<
331
+ OperationState<SqlVirtualMachinesCreateOrUpdateResponse>,
332
+ SqlVirtualMachinesCreateOrUpdateResponse
333
+ >
334
+ > {
306
335
  const directSendOperation = async (
307
336
  args: coreClient.OperationArguments,
308
337
  spec: coreClient.OperationSpec
309
- ): Promise<void> => {
338
+ ): Promise<SqlVirtualMachinesCreateOrUpdateResponse> => {
310
339
  return this.client.sendOperationRequest(args, spec);
311
340
  };
312
- const sendOperation = async (
341
+ const sendOperationFn = async (
313
342
  args: coreClient.OperationArguments,
314
343
  spec: coreClient.OperationSpec
315
344
  ) => {
@@ -342,58 +371,65 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
342
371
  };
343
372
  };
344
373
 
345
- const lro = new LroImpl(
346
- sendOperation,
347
- { resourceGroupName, sqlVirtualMachineName, options },
348
- startAssessmentOperationSpec
349
- );
350
- const poller = new LroEngine(lro, {
351
- resumeFrom: options?.resumeFrom,
352
- intervalInMs: options?.updateIntervalInMs
374
+ const lro = createLroSpec({
375
+ sendOperationFn,
376
+ args: { resourceGroupName, sqlVirtualMachineName, parameters, options },
377
+ spec: createOrUpdateOperationSpec
378
+ });
379
+ const poller = await createHttpPoller<
380
+ SqlVirtualMachinesCreateOrUpdateResponse,
381
+ OperationState<SqlVirtualMachinesCreateOrUpdateResponse>
382
+ >(lro, {
383
+ restoreFrom: options?.resumeFrom,
384
+ intervalInMs: options?.updateIntervalInMs,
385
+ resourceLocationConfig: "azure-async-operation"
353
386
  });
354
387
  await poller.poll();
355
388
  return poller;
356
389
  }
357
390
 
358
391
  /**
359
- * Starts Assessment on SQL virtual machine.
392
+ * Creates or updates a SQL virtual machine.
360
393
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
361
394
  * value from the Azure Resource Manager API or the portal.
362
395
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
396
+ * @param parameters The SQL virtual machine.
363
397
  * @param options The options parameters.
364
398
  */
365
- async beginStartAssessmentAndWait(
399
+ async beginCreateOrUpdateAndWait(
366
400
  resourceGroupName: string,
367
401
  sqlVirtualMachineName: string,
368
- options?: SqlVirtualMachinesStartAssessmentOptionalParams
369
- ): Promise<void> {
370
- const poller = await this.beginStartAssessment(
402
+ parameters: SqlVirtualMachine,
403
+ options?: SqlVirtualMachinesCreateOrUpdateOptionalParams
404
+ ): Promise<SqlVirtualMachinesCreateOrUpdateResponse> {
405
+ const poller = await this.beginCreateOrUpdate(
371
406
  resourceGroupName,
372
407
  sqlVirtualMachineName,
408
+ parameters,
373
409
  options
374
410
  );
375
411
  return poller.pollUntilDone();
376
412
  }
377
413
 
378
414
  /**
379
- * Uninstalls and reinstalls the SQL Iaas Extension.
415
+ * Deletes a SQL virtual machine.
380
416
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
381
417
  * value from the Azure Resource Manager API or the portal.
382
418
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
383
419
  * @param options The options parameters.
384
420
  */
385
- async beginRedeploy(
421
+ async beginDelete(
386
422
  resourceGroupName: string,
387
423
  sqlVirtualMachineName: string,
388
- options?: SqlVirtualMachinesRedeployOptionalParams
389
- ): Promise<PollerLike<PollOperationState<void>, void>> {
424
+ options?: SqlVirtualMachinesDeleteOptionalParams
425
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
390
426
  const directSendOperation = async (
391
427
  args: coreClient.OperationArguments,
392
428
  spec: coreClient.OperationSpec
393
429
  ): Promise<void> => {
394
430
  return this.client.sendOperationRequest(args, spec);
395
431
  };
396
- const sendOperation = async (
432
+ const sendOperationFn = async (
397
433
  args: coreClient.OperationArguments,
398
434
  spec: coreClient.OperationSpec
399
435
  ) => {
@@ -426,32 +462,33 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
426
462
  };
427
463
  };
428
464
 
429
- const lro = new LroImpl(
430
- sendOperation,
431
- { resourceGroupName, sqlVirtualMachineName, options },
432
- redeployOperationSpec
433
- );
434
- const poller = new LroEngine(lro, {
435
- resumeFrom: options?.resumeFrom,
436
- intervalInMs: options?.updateIntervalInMs
465
+ const lro = createLroSpec({
466
+ sendOperationFn,
467
+ args: { resourceGroupName, sqlVirtualMachineName, options },
468
+ spec: deleteOperationSpec
469
+ });
470
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
471
+ restoreFrom: options?.resumeFrom,
472
+ intervalInMs: options?.updateIntervalInMs,
473
+ resourceLocationConfig: "location"
437
474
  });
438
475
  await poller.poll();
439
476
  return poller;
440
477
  }
441
478
 
442
479
  /**
443
- * Uninstalls and reinstalls the SQL Iaas Extension.
480
+ * Deletes a SQL virtual machine.
444
481
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
445
482
  * value from the Azure Resource Manager API or the portal.
446
483
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
447
484
  * @param options The options parameters.
448
485
  */
449
- async beginRedeployAndWait(
486
+ async beginDeleteAndWait(
450
487
  resourceGroupName: string,
451
488
  sqlVirtualMachineName: string,
452
- options?: SqlVirtualMachinesRedeployOptionalParams
489
+ options?: SqlVirtualMachinesDeleteOptionalParams
453
490
  ): Promise<void> {
454
- const poller = await this.beginRedeploy(
491
+ const poller = await this.beginDelete(
455
492
  resourceGroupName,
456
493
  sqlVirtualMachineName,
457
494
  options
@@ -460,49 +497,31 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
460
497
  }
461
498
 
462
499
  /**
463
- * Gets a SQL virtual machine.
464
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
465
- * value from the Azure Resource Manager API or the portal.
466
- * @param sqlVirtualMachineName Name of the SQL virtual machine.
467
- * @param options The options parameters.
468
- */
469
- get(
470
- resourceGroupName: string,
471
- sqlVirtualMachineName: string,
472
- options?: SqlVirtualMachinesGetOptionalParams
473
- ): Promise<SqlVirtualMachinesGetResponse> {
474
- return this.client.sendOperationRequest(
475
- { resourceGroupName, sqlVirtualMachineName, options },
476
- getOperationSpec
477
- );
478
- }
479
-
480
- /**
481
- * Creates or updates a SQL virtual machine.
500
+ * Updates a SQL virtual machine.
482
501
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
483
502
  * value from the Azure Resource Manager API or the portal.
484
503
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
485
504
  * @param parameters The SQL virtual machine.
486
505
  * @param options The options parameters.
487
506
  */
488
- async beginCreateOrUpdate(
507
+ async beginUpdate(
489
508
  resourceGroupName: string,
490
509
  sqlVirtualMachineName: string,
491
- parameters: SqlVirtualMachine,
492
- options?: SqlVirtualMachinesCreateOrUpdateOptionalParams
510
+ parameters: SqlVirtualMachineUpdate,
511
+ options?: SqlVirtualMachinesUpdateOptionalParams
493
512
  ): Promise<
494
- PollerLike<
495
- PollOperationState<SqlVirtualMachinesCreateOrUpdateResponse>,
496
- SqlVirtualMachinesCreateOrUpdateResponse
513
+ SimplePollerLike<
514
+ OperationState<SqlVirtualMachinesUpdateResponse>,
515
+ SqlVirtualMachinesUpdateResponse
497
516
  >
498
517
  > {
499
518
  const directSendOperation = async (
500
519
  args: coreClient.OperationArguments,
501
520
  spec: coreClient.OperationSpec
502
- ): Promise<SqlVirtualMachinesCreateOrUpdateResponse> => {
521
+ ): Promise<SqlVirtualMachinesUpdateResponse> => {
503
522
  return this.client.sendOperationRequest(args, spec);
504
523
  };
505
- const sendOperation = async (
524
+ const sendOperationFn = async (
506
525
  args: coreClient.OperationArguments,
507
526
  spec: coreClient.OperationSpec
508
527
  ) => {
@@ -535,34 +554,38 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
535
554
  };
536
555
  };
537
556
 
538
- const lro = new LroImpl(
539
- sendOperation,
540
- { resourceGroupName, sqlVirtualMachineName, parameters, options },
541
- createOrUpdateOperationSpec
542
- );
543
- const poller = new LroEngine(lro, {
544
- resumeFrom: options?.resumeFrom,
545
- intervalInMs: options?.updateIntervalInMs
557
+ const lro = createLroSpec({
558
+ sendOperationFn,
559
+ args: { resourceGroupName, sqlVirtualMachineName, parameters, options },
560
+ spec: updateOperationSpec
561
+ });
562
+ const poller = await createHttpPoller<
563
+ SqlVirtualMachinesUpdateResponse,
564
+ OperationState<SqlVirtualMachinesUpdateResponse>
565
+ >(lro, {
566
+ restoreFrom: options?.resumeFrom,
567
+ intervalInMs: options?.updateIntervalInMs,
568
+ resourceLocationConfig: "azure-async-operation"
546
569
  });
547
570
  await poller.poll();
548
571
  return poller;
549
572
  }
550
573
 
551
574
  /**
552
- * Creates or updates a SQL virtual machine.
575
+ * Updates a SQL virtual machine.
553
576
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
554
577
  * value from the Azure Resource Manager API or the portal.
555
578
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
556
579
  * @param parameters The SQL virtual machine.
557
580
  * @param options The options parameters.
558
581
  */
559
- async beginCreateOrUpdateAndWait(
582
+ async beginUpdateAndWait(
560
583
  resourceGroupName: string,
561
584
  sqlVirtualMachineName: string,
562
- parameters: SqlVirtualMachine,
563
- options?: SqlVirtualMachinesCreateOrUpdateOptionalParams
564
- ): Promise<SqlVirtualMachinesCreateOrUpdateResponse> {
565
- const poller = await this.beginCreateOrUpdate(
585
+ parameters: SqlVirtualMachineUpdate,
586
+ options?: SqlVirtualMachinesUpdateOptionalParams
587
+ ): Promise<SqlVirtualMachinesUpdateResponse> {
588
+ const poller = await this.beginUpdate(
566
589
  resourceGroupName,
567
590
  sqlVirtualMachineName,
568
591
  parameters,
@@ -572,24 +595,40 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
572
595
  }
573
596
 
574
597
  /**
575
- * Deletes a SQL virtual machine.
598
+ * Gets all SQL virtual machines in a resource group.
599
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
600
+ * value from the Azure Resource Manager API or the portal.
601
+ * @param options The options parameters.
602
+ */
603
+ private _listByResourceGroup(
604
+ resourceGroupName: string,
605
+ options?: SqlVirtualMachinesListByResourceGroupOptionalParams
606
+ ): Promise<SqlVirtualMachinesListByResourceGroupResponse> {
607
+ return this.client.sendOperationRequest(
608
+ { resourceGroupName, options },
609
+ listByResourceGroupOperationSpec
610
+ );
611
+ }
612
+
613
+ /**
614
+ * Starts SQL best practices Assessment on SQL virtual machine.
576
615
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
577
616
  * value from the Azure Resource Manager API or the portal.
578
617
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
579
618
  * @param options The options parameters.
580
619
  */
581
- async beginDelete(
620
+ async beginStartAssessment(
582
621
  resourceGroupName: string,
583
622
  sqlVirtualMachineName: string,
584
- options?: SqlVirtualMachinesDeleteOptionalParams
585
- ): Promise<PollerLike<PollOperationState<void>, void>> {
623
+ options?: SqlVirtualMachinesStartAssessmentOptionalParams
624
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
586
625
  const directSendOperation = async (
587
626
  args: coreClient.OperationArguments,
588
627
  spec: coreClient.OperationSpec
589
628
  ): Promise<void> => {
590
629
  return this.client.sendOperationRequest(args, spec);
591
630
  };
592
- const sendOperation = async (
631
+ const sendOperationFn = async (
593
632
  args: coreClient.OperationArguments,
594
633
  spec: coreClient.OperationSpec
595
634
  ) => {
@@ -622,32 +661,33 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
622
661
  };
623
662
  };
624
663
 
625
- const lro = new LroImpl(
626
- sendOperation,
627
- { resourceGroupName, sqlVirtualMachineName, options },
628
- deleteOperationSpec
629
- );
630
- const poller = new LroEngine(lro, {
631
- resumeFrom: options?.resumeFrom,
632
- intervalInMs: options?.updateIntervalInMs
664
+ const lro = createLroSpec({
665
+ sendOperationFn,
666
+ args: { resourceGroupName, sqlVirtualMachineName, options },
667
+ spec: startAssessmentOperationSpec
668
+ });
669
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
670
+ restoreFrom: options?.resumeFrom,
671
+ intervalInMs: options?.updateIntervalInMs,
672
+ resourceLocationConfig: "location"
633
673
  });
634
674
  await poller.poll();
635
675
  return poller;
636
676
  }
637
677
 
638
678
  /**
639
- * Deletes a SQL virtual machine.
679
+ * Starts SQL best practices Assessment on SQL virtual machine.
640
680
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
641
681
  * value from the Azure Resource Manager API or the portal.
642
682
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
643
683
  * @param options The options parameters.
644
684
  */
645
- async beginDeleteAndWait(
685
+ async beginStartAssessmentAndWait(
646
686
  resourceGroupName: string,
647
687
  sqlVirtualMachineName: string,
648
- options?: SqlVirtualMachinesDeleteOptionalParams
688
+ options?: SqlVirtualMachinesStartAssessmentOptionalParams
649
689
  ): Promise<void> {
650
- const poller = await this.beginDelete(
690
+ const poller = await this.beginStartAssessment(
651
691
  resourceGroupName,
652
692
  sqlVirtualMachineName,
653
693
  options
@@ -656,31 +696,24 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
656
696
  }
657
697
 
658
698
  /**
659
- * Updates a SQL virtual machine.
699
+ * Uninstalls and reinstalls the SQL IaaS Extension.
660
700
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
661
701
  * value from the Azure Resource Manager API or the portal.
662
702
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
663
- * @param parameters The SQL virtual machine.
664
703
  * @param options The options parameters.
665
704
  */
666
- async beginUpdate(
705
+ async beginRedeploy(
667
706
  resourceGroupName: string,
668
707
  sqlVirtualMachineName: string,
669
- parameters: SqlVirtualMachineUpdate,
670
- options?: SqlVirtualMachinesUpdateOptionalParams
671
- ): Promise<
672
- PollerLike<
673
- PollOperationState<SqlVirtualMachinesUpdateResponse>,
674
- SqlVirtualMachinesUpdateResponse
675
- >
676
- > {
708
+ options?: SqlVirtualMachinesRedeployOptionalParams
709
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
677
710
  const directSendOperation = async (
678
711
  args: coreClient.OperationArguments,
679
712
  spec: coreClient.OperationSpec
680
- ): Promise<SqlVirtualMachinesUpdateResponse> => {
713
+ ): Promise<void> => {
681
714
  return this.client.sendOperationRequest(args, spec);
682
715
  };
683
- const sendOperation = async (
716
+ const sendOperationFn = async (
684
717
  args: coreClient.OperationArguments,
685
718
  spec: coreClient.OperationSpec
686
719
  ) => {
@@ -713,58 +746,40 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
713
746
  };
714
747
  };
715
748
 
716
- const lro = new LroImpl(
717
- sendOperation,
718
- { resourceGroupName, sqlVirtualMachineName, parameters, options },
719
- updateOperationSpec
720
- );
721
- const poller = new LroEngine(lro, {
722
- resumeFrom: options?.resumeFrom,
723
- intervalInMs: options?.updateIntervalInMs
749
+ const lro = createLroSpec({
750
+ sendOperationFn,
751
+ args: { resourceGroupName, sqlVirtualMachineName, options },
752
+ spec: redeployOperationSpec
753
+ });
754
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
755
+ restoreFrom: options?.resumeFrom,
756
+ intervalInMs: options?.updateIntervalInMs,
757
+ resourceLocationConfig: "location"
724
758
  });
725
759
  await poller.poll();
726
760
  return poller;
727
761
  }
728
762
 
729
763
  /**
730
- * Updates a SQL virtual machine.
764
+ * Uninstalls and reinstalls the SQL IaaS Extension.
731
765
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
732
766
  * value from the Azure Resource Manager API or the portal.
733
767
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
734
- * @param parameters The SQL virtual machine.
735
768
  * @param options The options parameters.
736
769
  */
737
- async beginUpdateAndWait(
770
+ async beginRedeployAndWait(
738
771
  resourceGroupName: string,
739
772
  sqlVirtualMachineName: string,
740
- parameters: SqlVirtualMachineUpdate,
741
- options?: SqlVirtualMachinesUpdateOptionalParams
742
- ): Promise<SqlVirtualMachinesUpdateResponse> {
743
- const poller = await this.beginUpdate(
773
+ options?: SqlVirtualMachinesRedeployOptionalParams
774
+ ): Promise<void> {
775
+ const poller = await this.beginRedeploy(
744
776
  resourceGroupName,
745
777
  sqlVirtualMachineName,
746
- parameters,
747
778
  options
748
779
  );
749
780
  return poller.pollUntilDone();
750
781
  }
751
782
 
752
- /**
753
- * Gets all SQL virtual machines in a resource group.
754
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
755
- * value from the Azure Resource Manager API or the portal.
756
- * @param options The options parameters.
757
- */
758
- private _listByResourceGroup(
759
- resourceGroupName: string,
760
- options?: SqlVirtualMachinesListByResourceGroupOptionalParams
761
- ): Promise<SqlVirtualMachinesListByResourceGroupResponse> {
762
- return this.client.sendOperationRequest(
763
- { resourceGroupName, options },
764
- listByResourceGroupOperationSpec
765
- );
766
- }
767
-
768
783
  /**
769
784
  * ListBySqlVmGroupNext
770
785
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
@@ -829,7 +844,9 @@ const listBySqlVmGroupOperationSpec: coreClient.OperationSpec = {
829
844
  200: {
830
845
  bodyMapper: Mappers.SqlVirtualMachineListResult
831
846
  },
832
- default: {}
847
+ default: {
848
+ bodyMapper: Mappers.ErrorResponse
849
+ }
833
850
  },
834
851
  queryParameters: [Parameters.apiVersion],
835
852
  urlParameters: [
@@ -849,41 +866,15 @@ const listOperationSpec: coreClient.OperationSpec = {
849
866
  200: {
850
867
  bodyMapper: Mappers.SqlVirtualMachineListResult
851
868
  },
852
- default: {}
869
+ default: {
870
+ bodyMapper: Mappers.ErrorResponse
871
+ }
853
872
  },
854
873
  queryParameters: [Parameters.apiVersion],
855
874
  urlParameters: [Parameters.$host, Parameters.subscriptionId],
856
875
  headerParameters: [Parameters.accept],
857
876
  serializer
858
877
  };
859
- const startAssessmentOperationSpec: coreClient.OperationSpec = {
860
- path:
861
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/startAssessment",
862
- httpMethod: "POST",
863
- responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
864
- queryParameters: [Parameters.apiVersion],
865
- urlParameters: [
866
- Parameters.$host,
867
- Parameters.resourceGroupName,
868
- Parameters.subscriptionId,
869
- Parameters.sqlVirtualMachineName
870
- ],
871
- serializer
872
- };
873
- const redeployOperationSpec: coreClient.OperationSpec = {
874
- path:
875
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/redeploy",
876
- httpMethod: "POST",
877
- responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
878
- queryParameters: [Parameters.apiVersion],
879
- urlParameters: [
880
- Parameters.$host,
881
- Parameters.resourceGroupName,
882
- Parameters.subscriptionId,
883
- Parameters.sqlVirtualMachineName
884
- ],
885
- serializer
886
- };
887
878
  const getOperationSpec: coreClient.OperationSpec = {
888
879
  path:
889
880
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
@@ -892,7 +883,9 @@ const getOperationSpec: coreClient.OperationSpec = {
892
883
  200: {
893
884
  bodyMapper: Mappers.SqlVirtualMachine
894
885
  },
895
- default: {}
886
+ default: {
887
+ bodyMapper: Mappers.ErrorResponse
888
+ }
896
889
  },
897
890
  queryParameters: [Parameters.expand, Parameters.apiVersion],
898
891
  urlParameters: [
@@ -921,7 +914,9 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
921
914
  204: {
922
915
  bodyMapper: Mappers.SqlVirtualMachine
923
916
  },
924
- default: {}
917
+ default: {
918
+ bodyMapper: Mappers.ErrorResponse
919
+ }
925
920
  },
926
921
  requestBody: Parameters.parameters3,
927
922
  queryParameters: [Parameters.apiVersion],
@@ -939,7 +934,15 @@ const deleteOperationSpec: coreClient.OperationSpec = {
939
934
  path:
940
935
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
941
936
  httpMethod: "DELETE",
942
- responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
937
+ responses: {
938
+ 200: {},
939
+ 201: {},
940
+ 202: {},
941
+ 204: {},
942
+ default: {
943
+ bodyMapper: Mappers.ErrorResponse
944
+ }
945
+ },
943
946
  queryParameters: [Parameters.apiVersion],
944
947
  urlParameters: [
945
948
  Parameters.$host,
@@ -947,6 +950,7 @@ const deleteOperationSpec: coreClient.OperationSpec = {
947
950
  Parameters.subscriptionId,
948
951
  Parameters.sqlVirtualMachineName
949
952
  ],
953
+ headerParameters: [Parameters.accept],
950
954
  serializer
951
955
  };
952
956
  const updateOperationSpec: coreClient.OperationSpec = {
@@ -966,7 +970,9 @@ const updateOperationSpec: coreClient.OperationSpec = {
966
970
  204: {
967
971
  bodyMapper: Mappers.SqlVirtualMachine
968
972
  },
969
- default: {}
973
+ default: {
974
+ bodyMapper: Mappers.ErrorResponse
975
+ }
970
976
  },
971
977
  requestBody: Parameters.parameters4,
972
978
  queryParameters: [Parameters.apiVersion],
@@ -988,7 +994,9 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
988
994
  200: {
989
995
  bodyMapper: Mappers.SqlVirtualMachineListResult
990
996
  },
991
- default: {}
997
+ default: {
998
+ bodyMapper: Mappers.ErrorResponse
999
+ }
992
1000
  },
993
1001
  queryParameters: [Parameters.apiVersion],
994
1002
  urlParameters: [
@@ -999,6 +1007,52 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
999
1007
  headerParameters: [Parameters.accept],
1000
1008
  serializer
1001
1009
  };
1010
+ const startAssessmentOperationSpec: coreClient.OperationSpec = {
1011
+ path:
1012
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/startAssessment",
1013
+ httpMethod: "POST",
1014
+ responses: {
1015
+ 200: {},
1016
+ 201: {},
1017
+ 202: {},
1018
+ 204: {},
1019
+ default: {
1020
+ bodyMapper: Mappers.ErrorResponse
1021
+ }
1022
+ },
1023
+ queryParameters: [Parameters.apiVersion],
1024
+ urlParameters: [
1025
+ Parameters.$host,
1026
+ Parameters.resourceGroupName,
1027
+ Parameters.subscriptionId,
1028
+ Parameters.sqlVirtualMachineName
1029
+ ],
1030
+ headerParameters: [Parameters.accept],
1031
+ serializer
1032
+ };
1033
+ const redeployOperationSpec: coreClient.OperationSpec = {
1034
+ path:
1035
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/redeploy",
1036
+ httpMethod: "POST",
1037
+ responses: {
1038
+ 200: {},
1039
+ 201: {},
1040
+ 202: {},
1041
+ 204: {},
1042
+ default: {
1043
+ bodyMapper: Mappers.ErrorResponse
1044
+ }
1045
+ },
1046
+ queryParameters: [Parameters.apiVersion],
1047
+ urlParameters: [
1048
+ Parameters.$host,
1049
+ Parameters.resourceGroupName,
1050
+ Parameters.subscriptionId,
1051
+ Parameters.sqlVirtualMachineName
1052
+ ],
1053
+ headerParameters: [Parameters.accept],
1054
+ serializer
1055
+ };
1002
1056
  const listBySqlVmGroupNextOperationSpec: coreClient.OperationSpec = {
1003
1057
  path: "{nextLink}",
1004
1058
  httpMethod: "GET",
@@ -1006,7 +1060,9 @@ const listBySqlVmGroupNextOperationSpec: coreClient.OperationSpec = {
1006
1060
  200: {
1007
1061
  bodyMapper: Mappers.SqlVirtualMachineListResult
1008
1062
  },
1009
- default: {}
1063
+ default: {
1064
+ bodyMapper: Mappers.ErrorResponse
1065
+ }
1010
1066
  },
1011
1067
  urlParameters: [
1012
1068
  Parameters.$host,
@@ -1025,7 +1081,9 @@ const listNextOperationSpec: coreClient.OperationSpec = {
1025
1081
  200: {
1026
1082
  bodyMapper: Mappers.SqlVirtualMachineListResult
1027
1083
  },
1028
- default: {}
1084
+ default: {
1085
+ bodyMapper: Mappers.ErrorResponse
1086
+ }
1029
1087
  },
1030
1088
  urlParameters: [
1031
1089
  Parameters.$host,
@@ -1042,7 +1100,9 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
1042
1100
  200: {
1043
1101
  bodyMapper: Mappers.SqlVirtualMachineListResult
1044
1102
  },
1045
- default: {}
1103
+ default: {
1104
+ bodyMapper: Mappers.ErrorResponse
1105
+ }
1046
1106
  },
1047
1107
  urlParameters: [
1048
1108
  Parameters.$host,