@azure/arm-sqlvirtualmachine 5.0.0-beta.2 → 5.0.0-beta.5

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 (136) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/LICENSE +1 -1
  3. package/README.md +11 -0
  4. package/dist/index.js +719 -91
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.js +50 -0
  11. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.js +32 -0
  15. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.js +32 -0
  19. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js +45 -0
  23. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js.map +1 -0
  24. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/operationsListSample.js +43 -0
  27. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  28. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.js +46 -0
  31. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.js.map +1 -0
  32. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.js +31 -0
  35. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.js.map +1 -0
  36. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.js +31 -0
  39. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.js.map +1 -0
  40. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js +44 -0
  43. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js.map +1 -0
  44. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js +43 -0
  47. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js.map +1 -0
  48. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.js +32 -0
  51. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.js.map +1 -0
  52. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js +269 -0
  55. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js.map +1 -0
  56. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.js +31 -0
  59. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.js.map +1 -0
  60. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.d.ts +2 -0
  61. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.js +31 -0
  63. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.js.map +1 -0
  64. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.d.ts +2 -0
  65. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js +44 -0
  67. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js.map +1 -0
  68. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.d.ts +2 -0
  69. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.d.ts.map +1 -0
  70. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js +45 -0
  71. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js.map +1 -0
  72. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.d.ts +2 -0
  73. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.d.ts.map +1 -0
  74. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js +43 -0
  75. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js.map +1 -0
  76. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.d.ts +2 -0
  77. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.d.ts.map +1 -0
  78. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.js +31 -0
  79. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.js.map +1 -0
  80. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.d.ts +2 -0
  81. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.d.ts.map +1 -0
  82. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js +31 -0
  83. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js.map +1 -0
  84. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.d.ts +2 -0
  85. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.d.ts.map +1 -0
  86. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.js +32 -0
  87. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.js.map +1 -0
  88. package/dist-esm/src/models/index.d.ts +237 -4
  89. package/dist-esm/src/models/index.d.ts.map +1 -1
  90. package/dist-esm/src/models/index.js +45 -0
  91. package/dist-esm/src/models/index.js.map +1 -1
  92. package/dist-esm/src/models/mappers.d.ts +7 -0
  93. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  94. package/dist-esm/src/models/mappers.js +334 -3
  95. package/dist-esm/src/models/mappers.js.map +1 -1
  96. package/dist-esm/src/models/parameters.d.ts +1 -1
  97. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  98. package/dist-esm/src/models/parameters.js +10 -10
  99. package/dist-esm/src/models/parameters.js.map +1 -1
  100. package/dist-esm/src/operations/availabilityGroupListeners.d.ts.map +1 -1
  101. package/dist-esm/src/operations/availabilityGroupListeners.js +7 -3
  102. package/dist-esm/src/operations/availabilityGroupListeners.js.map +1 -1
  103. package/dist-esm/src/operations/operations.d.ts +2 -2
  104. package/dist-esm/src/operations/operations.js +2 -2
  105. package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts.map +1 -1
  106. package/dist-esm/src/operations/sqlVirtualMachineGroups.js +9 -3
  107. package/dist-esm/src/operations/sqlVirtualMachineGroups.js.map +1 -1
  108. package/dist-esm/src/operations/sqlVirtualMachines.d.ts +33 -1
  109. package/dist-esm/src/operations/sqlVirtualMachines.d.ts.map +1 -1
  110. package/dist-esm/src/operations/sqlVirtualMachines.js +142 -4
  111. package/dist-esm/src/operations/sqlVirtualMachines.js.map +1 -1
  112. package/dist-esm/src/operationsInterfaces/operations.d.ts +1 -1
  113. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts +33 -1
  114. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts.map +1 -1
  115. package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts +2 -0
  116. package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts.map +1 -1
  117. package/dist-esm/src/sqlVirtualMachineManagementClient.js +50 -3
  118. package/dist-esm/src/sqlVirtualMachineManagementClient.js.map +1 -1
  119. package/dist-esm/test/sampleTest.js +11 -13
  120. package/dist-esm/test/sampleTest.js.map +1 -1
  121. package/package.json +48 -18
  122. package/review/arm-sqlvirtualmachine.api.md +176 -3
  123. package/rollup.config.js +6 -72
  124. package/src/models/index.ts +269 -4
  125. package/src/models/mappers.ts +344 -1
  126. package/src/models/parameters.ts +11 -11
  127. package/src/operations/availabilityGroupListeners.ts +7 -3
  128. package/src/operations/operations.ts +2 -2
  129. package/src/operations/sqlVirtualMachineGroups.ts +9 -3
  130. package/src/operations/sqlVirtualMachines.ts +208 -4
  131. package/src/operationsInterfaces/operations.ts +1 -1
  132. package/src/operationsInterfaces/sqlVirtualMachines.ts +51 -1
  133. package/src/sqlVirtualMachineManagementClient.ts +62 -3
  134. package/tsconfig.json +19 -5
  135. package/types/arm-sqlvirtualmachine.d.ts +294 -5
  136. package/types/tsdoc-metadata.json +1 -1
@@ -24,6 +24,7 @@ import {
24
24
  SqlVirtualMachinesListByResourceGroupOptionalParams,
25
25
  SqlVirtualMachinesListBySqlVmGroupResponse,
26
26
  SqlVirtualMachinesListResponse,
27
+ SqlVirtualMachinesRedeployOptionalParams,
27
28
  SqlVirtualMachinesGetOptionalParams,
28
29
  SqlVirtualMachinesGetResponse,
29
30
  SqlVirtualMachinesCreateOrUpdateOptionalParams,
@@ -33,6 +34,7 @@ import {
33
34
  SqlVirtualMachinesUpdateOptionalParams,
34
35
  SqlVirtualMachinesUpdateResponse,
35
36
  SqlVirtualMachinesListByResourceGroupResponse,
37
+ SqlVirtualMachinesStartAssessmentOptionalParams,
36
38
  SqlVirtualMachinesListBySqlVmGroupNextResponse,
37
39
  SqlVirtualMachinesListNextResponse,
38
40
  SqlVirtualMachinesListByResourceGroupNextResponse
@@ -247,6 +249,90 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
247
249
  return this.client.sendOperationRequest({ options }, listOperationSpec);
248
250
  }
249
251
 
252
+ /**
253
+ * Uninstalls and reinstalls the SQL Iaas Extension.
254
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
255
+ * value from the Azure Resource Manager API or the portal.
256
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
257
+ * @param options The options parameters.
258
+ */
259
+ async beginRedeploy(
260
+ resourceGroupName: string,
261
+ sqlVirtualMachineName: string,
262
+ options?: SqlVirtualMachinesRedeployOptionalParams
263
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
264
+ const directSendOperation = async (
265
+ args: coreClient.OperationArguments,
266
+ spec: coreClient.OperationSpec
267
+ ): Promise<void> => {
268
+ return this.client.sendOperationRequest(args, spec);
269
+ };
270
+ const sendOperation = async (
271
+ args: coreClient.OperationArguments,
272
+ spec: coreClient.OperationSpec
273
+ ) => {
274
+ let currentRawResponse:
275
+ | coreClient.FullOperationResponse
276
+ | undefined = undefined;
277
+ const providedCallback = args.options?.onResponse;
278
+ const callback: coreClient.RawResponseCallback = (
279
+ rawResponse: coreClient.FullOperationResponse,
280
+ flatResponse: unknown
281
+ ) => {
282
+ currentRawResponse = rawResponse;
283
+ providedCallback?.(rawResponse, flatResponse);
284
+ };
285
+ const updatedArgs = {
286
+ ...args,
287
+ options: {
288
+ ...args.options,
289
+ onResponse: callback
290
+ }
291
+ };
292
+ const flatResponse = await directSendOperation(updatedArgs, spec);
293
+ return {
294
+ flatResponse,
295
+ rawResponse: {
296
+ statusCode: currentRawResponse!.status,
297
+ body: currentRawResponse!.parsedBody,
298
+ headers: currentRawResponse!.headers.toJSON()
299
+ }
300
+ };
301
+ };
302
+
303
+ const lro = new LroImpl(
304
+ sendOperation,
305
+ { resourceGroupName, sqlVirtualMachineName, options },
306
+ redeployOperationSpec
307
+ );
308
+ const poller = new LroEngine(lro, {
309
+ resumeFrom: options?.resumeFrom,
310
+ intervalInMs: options?.updateIntervalInMs
311
+ });
312
+ await poller.poll();
313
+ return poller;
314
+ }
315
+
316
+ /**
317
+ * Uninstalls and reinstalls the SQL Iaas Extension.
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 options The options parameters.
322
+ */
323
+ async beginRedeployAndWait(
324
+ resourceGroupName: string,
325
+ sqlVirtualMachineName: string,
326
+ options?: SqlVirtualMachinesRedeployOptionalParams
327
+ ): Promise<void> {
328
+ const poller = await this.beginRedeploy(
329
+ resourceGroupName,
330
+ sqlVirtualMachineName,
331
+ options
332
+ );
333
+ return poller.pollUntilDone();
334
+ }
335
+
250
336
  /**
251
337
  * Gets a SQL virtual machine.
252
338
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
@@ -328,10 +414,12 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
328
414
  { resourceGroupName, sqlVirtualMachineName, parameters, options },
329
415
  createOrUpdateOperationSpec
330
416
  );
331
- return new LroEngine(lro, {
417
+ const poller = new LroEngine(lro, {
332
418
  resumeFrom: options?.resumeFrom,
333
419
  intervalInMs: options?.updateIntervalInMs
334
420
  });
421
+ await poller.poll();
422
+ return poller;
335
423
  }
336
424
 
337
425
  /**
@@ -413,10 +501,12 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
413
501
  { resourceGroupName, sqlVirtualMachineName, options },
414
502
  deleteOperationSpec
415
503
  );
416
- return new LroEngine(lro, {
504
+ const poller = new LroEngine(lro, {
417
505
  resumeFrom: options?.resumeFrom,
418
506
  intervalInMs: options?.updateIntervalInMs
419
507
  });
508
+ await poller.poll();
509
+ return poller;
420
510
  }
421
511
 
422
512
  /**
@@ -502,10 +592,12 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
502
592
  { resourceGroupName, sqlVirtualMachineName, parameters, options },
503
593
  updateOperationSpec
504
594
  );
505
- return new LroEngine(lro, {
595
+ const poller = new LroEngine(lro, {
506
596
  resumeFrom: options?.resumeFrom,
507
597
  intervalInMs: options?.updateIntervalInMs
508
598
  });
599
+ await poller.poll();
600
+ return poller;
509
601
  }
510
602
 
511
603
  /**
@@ -547,6 +639,90 @@ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
547
639
  );
548
640
  }
549
641
 
642
+ /**
643
+ * Starts Assessment on SQL virtual machine.
644
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
645
+ * value from the Azure Resource Manager API or the portal.
646
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
647
+ * @param options The options parameters.
648
+ */
649
+ async beginStartAssessment(
650
+ resourceGroupName: string,
651
+ sqlVirtualMachineName: string,
652
+ options?: SqlVirtualMachinesStartAssessmentOptionalParams
653
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
654
+ const directSendOperation = async (
655
+ args: coreClient.OperationArguments,
656
+ spec: coreClient.OperationSpec
657
+ ): Promise<void> => {
658
+ return this.client.sendOperationRequest(args, spec);
659
+ };
660
+ const sendOperation = async (
661
+ args: coreClient.OperationArguments,
662
+ spec: coreClient.OperationSpec
663
+ ) => {
664
+ let currentRawResponse:
665
+ | coreClient.FullOperationResponse
666
+ | undefined = undefined;
667
+ const providedCallback = args.options?.onResponse;
668
+ const callback: coreClient.RawResponseCallback = (
669
+ rawResponse: coreClient.FullOperationResponse,
670
+ flatResponse: unknown
671
+ ) => {
672
+ currentRawResponse = rawResponse;
673
+ providedCallback?.(rawResponse, flatResponse);
674
+ };
675
+ const updatedArgs = {
676
+ ...args,
677
+ options: {
678
+ ...args.options,
679
+ onResponse: callback
680
+ }
681
+ };
682
+ const flatResponse = await directSendOperation(updatedArgs, spec);
683
+ return {
684
+ flatResponse,
685
+ rawResponse: {
686
+ statusCode: currentRawResponse!.status,
687
+ body: currentRawResponse!.parsedBody,
688
+ headers: currentRawResponse!.headers.toJSON()
689
+ }
690
+ };
691
+ };
692
+
693
+ const lro = new LroImpl(
694
+ sendOperation,
695
+ { resourceGroupName, sqlVirtualMachineName, options },
696
+ startAssessmentOperationSpec
697
+ );
698
+ const poller = new LroEngine(lro, {
699
+ resumeFrom: options?.resumeFrom,
700
+ intervalInMs: options?.updateIntervalInMs
701
+ });
702
+ await poller.poll();
703
+ return poller;
704
+ }
705
+
706
+ /**
707
+ * Starts Assessment on SQL virtual machine.
708
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
709
+ * value from the Azure Resource Manager API or the portal.
710
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
711
+ * @param options The options parameters.
712
+ */
713
+ async beginStartAssessmentAndWait(
714
+ resourceGroupName: string,
715
+ sqlVirtualMachineName: string,
716
+ options?: SqlVirtualMachinesStartAssessmentOptionalParams
717
+ ): Promise<void> {
718
+ const poller = await this.beginStartAssessment(
719
+ resourceGroupName,
720
+ sqlVirtualMachineName,
721
+ options
722
+ );
723
+ return poller.pollUntilDone();
724
+ }
725
+
550
726
  /**
551
727
  * ListBySqlVmGroupNext
552
728
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
@@ -638,6 +814,20 @@ const listOperationSpec: coreClient.OperationSpec = {
638
814
  headerParameters: [Parameters.accept],
639
815
  serializer
640
816
  };
817
+ const redeployOperationSpec: coreClient.OperationSpec = {
818
+ path:
819
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/redeploy",
820
+ httpMethod: "POST",
821
+ responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
822
+ queryParameters: [Parameters.apiVersion],
823
+ urlParameters: [
824
+ Parameters.$host,
825
+ Parameters.resourceGroupName,
826
+ Parameters.subscriptionId,
827
+ Parameters.sqlVirtualMachineName
828
+ ],
829
+ serializer
830
+ };
641
831
  const getOperationSpec: coreClient.OperationSpec = {
642
832
  path:
643
833
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
@@ -648,7 +838,7 @@ const getOperationSpec: coreClient.OperationSpec = {
648
838
  },
649
839
  default: {}
650
840
  },
651
- queryParameters: [Parameters.apiVersion, Parameters.expand],
841
+ queryParameters: [Parameters.expand, Parameters.apiVersion],
652
842
  urlParameters: [
653
843
  Parameters.$host,
654
844
  Parameters.resourceGroupName,
@@ -753,6 +943,20 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
753
943
  headerParameters: [Parameters.accept],
754
944
  serializer
755
945
  };
946
+ const startAssessmentOperationSpec: coreClient.OperationSpec = {
947
+ path:
948
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/startAssessment",
949
+ httpMethod: "POST",
950
+ responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
951
+ queryParameters: [Parameters.apiVersion],
952
+ urlParameters: [
953
+ Parameters.$host,
954
+ Parameters.resourceGroupName,
955
+ Parameters.subscriptionId,
956
+ Parameters.sqlVirtualMachineName
957
+ ],
958
+ serializer
959
+ };
756
960
  const listBySqlVmGroupNextOperationSpec: coreClient.OperationSpec = {
757
961
  path: "{nextLink}",
758
962
  httpMethod: "GET",
@@ -13,7 +13,7 @@ import { Operation, OperationsListOptionalParams } from "../models";
13
13
  /** Interface representing a Operations. */
14
14
  export interface Operations {
15
15
  /**
16
- * Lists all of the available SQL Rest API operations.
16
+ * Lists all of the available SQL Virtual Machine Rest API operations.
17
17
  * @param options The options parameters.
18
18
  */
19
19
  list(
@@ -13,6 +13,7 @@ import {
13
13
  SqlVirtualMachinesListBySqlVmGroupOptionalParams,
14
14
  SqlVirtualMachinesListOptionalParams,
15
15
  SqlVirtualMachinesListByResourceGroupOptionalParams,
16
+ SqlVirtualMachinesRedeployOptionalParams,
16
17
  SqlVirtualMachinesGetOptionalParams,
17
18
  SqlVirtualMachinesGetResponse,
18
19
  SqlVirtualMachinesCreateOrUpdateOptionalParams,
@@ -20,7 +21,8 @@ import {
20
21
  SqlVirtualMachinesDeleteOptionalParams,
21
22
  SqlVirtualMachineUpdate,
22
23
  SqlVirtualMachinesUpdateOptionalParams,
23
- SqlVirtualMachinesUpdateResponse
24
+ SqlVirtualMachinesUpdateResponse,
25
+ SqlVirtualMachinesStartAssessmentOptionalParams
24
26
  } from "../models";
25
27
 
26
28
  /// <reference lib="esnext.asynciterable" />
@@ -55,6 +57,30 @@ export interface SqlVirtualMachines {
55
57
  resourceGroupName: string,
56
58
  options?: SqlVirtualMachinesListByResourceGroupOptionalParams
57
59
  ): PagedAsyncIterableIterator<SqlVirtualMachine>;
60
+ /**
61
+ * Uninstalls and reinstalls the SQL Iaas Extension.
62
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
63
+ * value from the Azure Resource Manager API or the portal.
64
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
65
+ * @param options The options parameters.
66
+ */
67
+ beginRedeploy(
68
+ resourceGroupName: string,
69
+ sqlVirtualMachineName: string,
70
+ options?: SqlVirtualMachinesRedeployOptionalParams
71
+ ): Promise<PollerLike<PollOperationState<void>, void>>;
72
+ /**
73
+ * Uninstalls and reinstalls the SQL Iaas Extension.
74
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
75
+ * value from the Azure Resource Manager API or the portal.
76
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
77
+ * @param options The options parameters.
78
+ */
79
+ beginRedeployAndWait(
80
+ resourceGroupName: string,
81
+ sqlVirtualMachineName: string,
82
+ options?: SqlVirtualMachinesRedeployOptionalParams
83
+ ): Promise<void>;
58
84
  /**
59
85
  * Gets a SQL virtual machine.
60
86
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
@@ -157,4 +183,28 @@ export interface SqlVirtualMachines {
157
183
  parameters: SqlVirtualMachineUpdate,
158
184
  options?: SqlVirtualMachinesUpdateOptionalParams
159
185
  ): Promise<SqlVirtualMachinesUpdateResponse>;
186
+ /**
187
+ * Starts Assessment on SQL virtual machine.
188
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
189
+ * value from the Azure Resource Manager API or the portal.
190
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
191
+ * @param options The options parameters.
192
+ */
193
+ beginStartAssessment(
194
+ resourceGroupName: string,
195
+ sqlVirtualMachineName: string,
196
+ options?: SqlVirtualMachinesStartAssessmentOptionalParams
197
+ ): Promise<PollerLike<PollOperationState<void>, void>>;
198
+ /**
199
+ * Starts Assessment on SQL virtual machine.
200
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
201
+ * value from the Azure Resource Manager API or the portal.
202
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
203
+ * @param options The options parameters.
204
+ */
205
+ beginStartAssessmentAndWait(
206
+ resourceGroupName: string,
207
+ sqlVirtualMachineName: string,
208
+ options?: SqlVirtualMachinesStartAssessmentOptionalParams
209
+ ): Promise<void>;
160
210
  }
@@ -7,6 +7,12 @@
7
7
  */
8
8
 
9
9
  import * as coreClient from "@azure/core-client";
10
+ import * as coreRestPipeline from "@azure/core-rest-pipeline";
11
+ import {
12
+ PipelineRequest,
13
+ PipelineResponse,
14
+ SendRequest
15
+ } from "@azure/core-rest-pipeline";
10
16
  import * as coreAuth from "@azure/core-auth";
11
17
  import {
12
18
  AvailabilityGroupListenersImpl,
@@ -54,7 +60,7 @@ export class SqlVirtualMachineManagementClient extends coreClient.ServiceClient
54
60
  credential: credentials
55
61
  };
56
62
 
57
- const packageDetails = `azsdk-js-arm-sqlvirtualmachine/5.0.0-beta.2`;
63
+ const packageDetails = `azsdk-js-arm-sqlvirtualmachine/5.0.0-beta.5`;
58
64
  const userAgentPrefix =
59
65
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
60
66
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
@@ -69,19 +75,72 @@ export class SqlVirtualMachineManagementClient extends coreClient.ServiceClient
69
75
  userAgentOptions: {
70
76
  userAgentPrefix
71
77
  },
72
- baseUri: options.endpoint || "https://management.azure.com"
78
+ baseUri:
79
+ options.endpoint ?? options.baseUri ?? "https://management.azure.com"
73
80
  };
74
81
  super(optionsWithDefaults);
82
+
83
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
84
+ const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
85
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
86
+ (pipelinePolicy) =>
87
+ pipelinePolicy.name ===
88
+ coreRestPipeline.bearerTokenAuthenticationPolicyName
89
+ );
90
+ if (!bearerTokenAuthenticationPolicyFound) {
91
+ this.pipeline.removePolicy({
92
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
93
+ });
94
+ this.pipeline.addPolicy(
95
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
96
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
97
+ challengeCallbacks: {
98
+ authorizeRequestOnChallenge:
99
+ coreClient.authorizeRequestOnClaimChallenge
100
+ }
101
+ })
102
+ );
103
+ }
104
+ }
75
105
  // Parameter assignments
76
106
  this.subscriptionId = subscriptionId;
77
107
 
78
108
  // Assigning values to Constant parameters
79
109
  this.$host = options.$host || "https://management.azure.com";
80
- this.apiVersion = options.apiVersion || "2017-03-01-preview";
110
+ this.apiVersion = options.apiVersion || "2021-11-01-preview";
81
111
  this.availabilityGroupListeners = new AvailabilityGroupListenersImpl(this);
82
112
  this.operations = new OperationsImpl(this);
83
113
  this.sqlVirtualMachineGroups = new SqlVirtualMachineGroupsImpl(this);
84
114
  this.sqlVirtualMachines = new SqlVirtualMachinesImpl(this);
115
+ this.addCustomApiVersionPolicy(options.apiVersion);
116
+ }
117
+
118
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
119
+ private addCustomApiVersionPolicy(apiVersion?: string) {
120
+ if (!apiVersion) {
121
+ return;
122
+ }
123
+ const apiVersionPolicy = {
124
+ name: "CustomApiVersionPolicy",
125
+ async sendRequest(
126
+ request: PipelineRequest,
127
+ next: SendRequest
128
+ ): Promise<PipelineResponse> {
129
+ const param = request.url.split("?");
130
+ if (param.length > 1) {
131
+ const newParams = param[1].split("&").map((item) => {
132
+ if (item.indexOf("api-version") > -1) {
133
+ return item.replace(/(?<==).*$/, apiVersion);
134
+ } else {
135
+ return item;
136
+ }
137
+ });
138
+ request.url = param[0] + "?" + newParams.join("&");
139
+ }
140
+ return next(request);
141
+ }
142
+ };
143
+ this.pipeline.addPolicy(apiVersionPolicy);
85
144
  }
86
145
 
87
146
  availabilityGroupListeners: AvailabilityGroupListeners;
package/tsconfig.json CHANGED
@@ -9,11 +9,25 @@
9
9
  "esModuleInterop": true,
10
10
  "allowSyntheticDefaultImports": true,
11
11
  "forceConsistentCasingInFileNames": true,
12
- "lib": ["es6", "dom"],
12
+ "lib": [
13
+ "es6",
14
+ "dom"
15
+ ],
13
16
  "declaration": true,
14
17
  "outDir": "./dist-esm",
15
- "importHelpers": true
18
+ "importHelpers": true,
19
+ "paths": {
20
+ "@azure/arm-sqlvirtualmachine": [
21
+ "./src/index"
22
+ ]
23
+ }
16
24
  },
17
- "include": ["./src/**/*.ts", "./test/**/*.ts"],
18
- "exclude": ["node_modules"]
19
- }
25
+ "include": [
26
+ "./src/**/*.ts",
27
+ "./test/**/*.ts",
28
+ "samples-dev/**/*.ts"
29
+ ],
30
+ "exclude": [
31
+ "node_modules"
32
+ ]
33
+ }