@azure/arm-elasticsan 1.0.0-beta.2 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +6 -2
  2. package/README.md +1 -1
  3. package/dist/index.js +899 -123
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/elasticSansCreateSample.js +7 -6
  8. package/dist-esm/samples-dev/elasticSansCreateSample.js.map +1 -1
  9. package/dist-esm/samples-dev/elasticSansDeleteSample.js +2 -2
  10. package/dist-esm/samples-dev/elasticSansGetSample.js +2 -2
  11. package/dist-esm/samples-dev/elasticSansListByResourceGroupSample.js +2 -2
  12. package/dist-esm/samples-dev/elasticSansListBySubscriptionSample.js +2 -2
  13. package/dist-esm/samples-dev/elasticSansUpdateSample.js +6 -5
  14. package/dist-esm/samples-dev/elasticSansUpdateSample.js.map +1 -1
  15. package/dist-esm/samples-dev/operationsListSample.js +2 -2
  16. package/dist-esm/samples-dev/privateEndpointConnectionsCreateSample.js +6 -10
  17. package/dist-esm/samples-dev/privateEndpointConnectionsCreateSample.js.map +1 -1
  18. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js +2 -2
  19. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js +2 -2
  20. package/dist-esm/samples-dev/privateEndpointConnectionsListSample.js +2 -2
  21. package/dist-esm/samples-dev/privateLinkResourcesListByElasticSanSample.js +2 -2
  22. package/dist-esm/samples-dev/skusListSample.js +3 -3
  23. package/dist-esm/samples-dev/skusListSample.js.map +1 -1
  24. package/dist-esm/samples-dev/volumeGroupsCreateSample.js +12 -3
  25. package/dist-esm/samples-dev/volumeGroupsCreateSample.js.map +1 -1
  26. package/dist-esm/samples-dev/volumeGroupsDeleteSample.js +2 -2
  27. package/dist-esm/samples-dev/volumeGroupsGetSample.js +2 -2
  28. package/dist-esm/samples-dev/volumeGroupsListByElasticSanSample.js +2 -2
  29. package/dist-esm/samples-dev/volumeGroupsUpdateSample.js +11 -2
  30. package/dist-esm/samples-dev/volumeGroupsUpdateSample.js.map +1 -1
  31. package/dist-esm/samples-dev/volumeSnapshotsCreateSample.d.ts +2 -0
  32. package/dist-esm/samples-dev/volumeSnapshotsCreateSample.d.ts.map +1 -0
  33. package/dist-esm/samples-dev/volumeSnapshotsCreateSample.js +70 -0
  34. package/dist-esm/samples-dev/volumeSnapshotsCreateSample.js.map +1 -0
  35. package/dist-esm/samples-dev/volumeSnapshotsDeleteSample.d.ts +2 -0
  36. package/dist-esm/samples-dev/volumeSnapshotsDeleteSample.d.ts.map +1 -0
  37. package/dist-esm/samples-dev/volumeSnapshotsDeleteSample.js +60 -0
  38. package/dist-esm/samples-dev/volumeSnapshotsDeleteSample.js.map +1 -0
  39. package/dist-esm/samples-dev/volumeSnapshotsGetSample.d.ts +2 -0
  40. package/dist-esm/samples-dev/volumeSnapshotsGetSample.d.ts.map +1 -0
  41. package/dist-esm/samples-dev/volumeSnapshotsGetSample.js +60 -0
  42. package/dist-esm/samples-dev/volumeSnapshotsGetSample.js.map +1 -0
  43. package/dist-esm/samples-dev/volumeSnapshotsListByVolumeGroupSample.d.ts +2 -0
  44. package/dist-esm/samples-dev/volumeSnapshotsListByVolumeGroupSample.d.ts.map +1 -0
  45. package/dist-esm/samples-dev/volumeSnapshotsListByVolumeGroupSample.js +102 -0
  46. package/dist-esm/samples-dev/volumeSnapshotsListByVolumeGroupSample.js.map +1 -0
  47. package/dist-esm/samples-dev/volumesCreateSample.js +6 -5
  48. package/dist-esm/samples-dev/volumesCreateSample.js.map +1 -1
  49. package/dist-esm/samples-dev/volumesDeleteSample.js +9 -3
  50. package/dist-esm/samples-dev/volumesDeleteSample.js.map +1 -1
  51. package/dist-esm/samples-dev/volumesGetSample.js +2 -2
  52. package/dist-esm/samples-dev/volumesListByVolumeGroupSample.js +2 -2
  53. package/dist-esm/samples-dev/volumesUpdateSample.js +2 -2
  54. package/dist-esm/src/elasticSanManagement.d.ts +2 -1
  55. package/dist-esm/src/elasticSanManagement.d.ts.map +1 -1
  56. package/dist-esm/src/elasticSanManagement.js +4 -3
  57. package/dist-esm/src/elasticSanManagement.js.map +1 -1
  58. package/dist-esm/src/models/index.d.ts +284 -13
  59. package/dist-esm/src/models/index.d.ts.map +1 -1
  60. package/dist-esm/src/models/index.js +56 -0
  61. package/dist-esm/src/models/index.js.map +1 -1
  62. package/dist-esm/src/models/mappers.d.ts +10 -0
  63. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  64. package/dist-esm/src/models/mappers.js +303 -20
  65. package/dist-esm/src/models/mappers.js.map +1 -1
  66. package/dist-esm/src/models/parameters.d.ts +4 -0
  67. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  68. package/dist-esm/src/models/parameters.js +39 -2
  69. package/dist-esm/src/models/parameters.js.map +1 -1
  70. package/dist-esm/src/operations/index.d.ts +1 -0
  71. package/dist-esm/src/operations/index.d.ts.map +1 -1
  72. package/dist-esm/src/operations/index.js +1 -0
  73. package/dist-esm/src/operations/index.js.map +1 -1
  74. package/dist-esm/src/operations/volumeSnapshots.d.ts +89 -0
  75. package/dist-esm/src/operations/volumeSnapshots.d.ts.map +1 -0
  76. package/dist-esm/src/operations/volumeSnapshots.js +395 -0
  77. package/dist-esm/src/operations/volumeSnapshots.js.map +1 -0
  78. package/dist-esm/src/operations/volumes.js +5 -1
  79. package/dist-esm/src/operations/volumes.js.map +1 -1
  80. package/dist-esm/src/operationsInterfaces/index.d.ts +1 -0
  81. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  82. package/dist-esm/src/operationsInterfaces/index.js +1 -0
  83. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  84. package/dist-esm/src/operationsInterfaces/volumeSnapshots.d.ts +62 -0
  85. package/dist-esm/src/operationsInterfaces/volumeSnapshots.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/volumeSnapshots.js +9 -0
  87. package/dist-esm/src/operationsInterfaces/volumeSnapshots.js.map +1 -0
  88. package/package.json +12 -18
  89. package/review/arm-elasticsan.api.md +187 -6
  90. package/src/elasticSanManagement.ts +8 -4
  91. package/src/models/index.ts +316 -18
  92. package/src/models/mappers.ts +323 -19
  93. package/src/models/parameters.ts +44 -2
  94. package/src/operations/index.ts +1 -0
  95. package/src/operations/volumeSnapshots.ts +551 -0
  96. package/src/operations/volumes.ts +5 -1
  97. package/src/operationsInterfaces/index.ts +1 -0
  98. package/src/operationsInterfaces/volumeSnapshots.ts +121 -0
  99. package/types/arm-elasticsan.d.ts +375 -14
  100. package/types/tsdoc-metadata.json +1 -1
  101. package/rollup.config.js +0 -122
@@ -0,0 +1,551 @@
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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
11
+ import { VolumeSnapshots } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
+ import * as Parameters from "../models/parameters";
15
+ import { ElasticSanManagement } from "../elasticSanManagement";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
22
+ import {
23
+ Snapshot,
24
+ VolumeSnapshotsListByVolumeGroupNextOptionalParams,
25
+ VolumeSnapshotsListByVolumeGroupOptionalParams,
26
+ VolumeSnapshotsListByVolumeGroupResponse,
27
+ VolumeSnapshotsCreateOptionalParams,
28
+ VolumeSnapshotsCreateResponse,
29
+ VolumeSnapshotsDeleteOptionalParams,
30
+ VolumeSnapshotsGetOptionalParams,
31
+ VolumeSnapshotsGetResponse,
32
+ VolumeSnapshotsListByVolumeGroupNextResponse
33
+ } from "../models";
34
+
35
+ /// <reference lib="esnext.asynciterable" />
36
+ /** Class containing VolumeSnapshots operations. */
37
+ export class VolumeSnapshotsImpl implements VolumeSnapshots {
38
+ private readonly client: ElasticSanManagement;
39
+
40
+ /**
41
+ * Initialize a new instance of the class VolumeSnapshots class.
42
+ * @param client Reference to the service client
43
+ */
44
+ constructor(client: ElasticSanManagement) {
45
+ this.client = client;
46
+ }
47
+
48
+ /**
49
+ * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter
50
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
51
+ * @param elasticSanName The name of the ElasticSan.
52
+ * @param volumeGroupName The name of the VolumeGroup.
53
+ * @param options The options parameters.
54
+ */
55
+ public listByVolumeGroup(
56
+ resourceGroupName: string,
57
+ elasticSanName: string,
58
+ volumeGroupName: string,
59
+ options?: VolumeSnapshotsListByVolumeGroupOptionalParams
60
+ ): PagedAsyncIterableIterator<Snapshot> {
61
+ const iter = this.listByVolumeGroupPagingAll(
62
+ resourceGroupName,
63
+ elasticSanName,
64
+ volumeGroupName,
65
+ options
66
+ );
67
+ return {
68
+ next() {
69
+ return iter.next();
70
+ },
71
+ [Symbol.asyncIterator]() {
72
+ return this;
73
+ },
74
+ byPage: (settings?: PageSettings) => {
75
+ if (settings?.maxPageSize) {
76
+ throw new Error("maxPageSize is not supported by this operation.");
77
+ }
78
+ return this.listByVolumeGroupPagingPage(
79
+ resourceGroupName,
80
+ elasticSanName,
81
+ volumeGroupName,
82
+ options,
83
+ settings
84
+ );
85
+ }
86
+ };
87
+ }
88
+
89
+ private async *listByVolumeGroupPagingPage(
90
+ resourceGroupName: string,
91
+ elasticSanName: string,
92
+ volumeGroupName: string,
93
+ options?: VolumeSnapshotsListByVolumeGroupOptionalParams,
94
+ settings?: PageSettings
95
+ ): AsyncIterableIterator<Snapshot[]> {
96
+ let result: VolumeSnapshotsListByVolumeGroupResponse;
97
+ let continuationToken = settings?.continuationToken;
98
+ if (!continuationToken) {
99
+ result = await this._listByVolumeGroup(
100
+ resourceGroupName,
101
+ elasticSanName,
102
+ volumeGroupName,
103
+ options
104
+ );
105
+ let page = result.value || [];
106
+ continuationToken = result.nextLink;
107
+ setContinuationToken(page, continuationToken);
108
+ yield page;
109
+ }
110
+ while (continuationToken) {
111
+ result = await this._listByVolumeGroupNext(
112
+ resourceGroupName,
113
+ elasticSanName,
114
+ volumeGroupName,
115
+ continuationToken,
116
+ options
117
+ );
118
+ continuationToken = result.nextLink;
119
+ let page = result.value || [];
120
+ setContinuationToken(page, continuationToken);
121
+ yield page;
122
+ }
123
+ }
124
+
125
+ private async *listByVolumeGroupPagingAll(
126
+ resourceGroupName: string,
127
+ elasticSanName: string,
128
+ volumeGroupName: string,
129
+ options?: VolumeSnapshotsListByVolumeGroupOptionalParams
130
+ ): AsyncIterableIterator<Snapshot> {
131
+ for await (const page of this.listByVolumeGroupPagingPage(
132
+ resourceGroupName,
133
+ elasticSanName,
134
+ volumeGroupName,
135
+ options
136
+ )) {
137
+ yield* page;
138
+ }
139
+ }
140
+
141
+ /**
142
+ * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter
143
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
144
+ * @param elasticSanName The name of the ElasticSan.
145
+ * @param volumeGroupName The name of the VolumeGroup.
146
+ * @param options The options parameters.
147
+ */
148
+ private _listByVolumeGroup(
149
+ resourceGroupName: string,
150
+ elasticSanName: string,
151
+ volumeGroupName: string,
152
+ options?: VolumeSnapshotsListByVolumeGroupOptionalParams
153
+ ): Promise<VolumeSnapshotsListByVolumeGroupResponse> {
154
+ return this.client.sendOperationRequest(
155
+ { resourceGroupName, elasticSanName, volumeGroupName, options },
156
+ listByVolumeGroupOperationSpec
157
+ );
158
+ }
159
+
160
+ /**
161
+ * Create a Volume Snapshot.
162
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
163
+ * @param elasticSanName The name of the ElasticSan.
164
+ * @param volumeGroupName The name of the VolumeGroup.
165
+ * @param snapshotName The name of the volume snapshot within the given volume group.
166
+ * @param parameters Snapshot object.
167
+ * @param options The options parameters.
168
+ */
169
+ async beginCreate(
170
+ resourceGroupName: string,
171
+ elasticSanName: string,
172
+ volumeGroupName: string,
173
+ snapshotName: string,
174
+ parameters: Snapshot,
175
+ options?: VolumeSnapshotsCreateOptionalParams
176
+ ): Promise<
177
+ SimplePollerLike<
178
+ OperationState<VolumeSnapshotsCreateResponse>,
179
+ VolumeSnapshotsCreateResponse
180
+ >
181
+ > {
182
+ const directSendOperation = async (
183
+ args: coreClient.OperationArguments,
184
+ spec: coreClient.OperationSpec
185
+ ): Promise<VolumeSnapshotsCreateResponse> => {
186
+ return this.client.sendOperationRequest(args, spec);
187
+ };
188
+ const sendOperationFn = async (
189
+ args: coreClient.OperationArguments,
190
+ spec: coreClient.OperationSpec
191
+ ) => {
192
+ let currentRawResponse:
193
+ | coreClient.FullOperationResponse
194
+ | undefined = undefined;
195
+ const providedCallback = args.options?.onResponse;
196
+ const callback: coreClient.RawResponseCallback = (
197
+ rawResponse: coreClient.FullOperationResponse,
198
+ flatResponse: unknown
199
+ ) => {
200
+ currentRawResponse = rawResponse;
201
+ providedCallback?.(rawResponse, flatResponse);
202
+ };
203
+ const updatedArgs = {
204
+ ...args,
205
+ options: {
206
+ ...args.options,
207
+ onResponse: callback
208
+ }
209
+ };
210
+ const flatResponse = await directSendOperation(updatedArgs, spec);
211
+ return {
212
+ flatResponse,
213
+ rawResponse: {
214
+ statusCode: currentRawResponse!.status,
215
+ body: currentRawResponse!.parsedBody,
216
+ headers: currentRawResponse!.headers.toJSON()
217
+ }
218
+ };
219
+ };
220
+
221
+ const lro = createLroSpec({
222
+ sendOperationFn,
223
+ args: {
224
+ resourceGroupName,
225
+ elasticSanName,
226
+ volumeGroupName,
227
+ snapshotName,
228
+ parameters,
229
+ options
230
+ },
231
+ spec: createOperationSpec
232
+ });
233
+ const poller = await createHttpPoller<
234
+ VolumeSnapshotsCreateResponse,
235
+ OperationState<VolumeSnapshotsCreateResponse>
236
+ >(lro, {
237
+ restoreFrom: options?.resumeFrom,
238
+ intervalInMs: options?.updateIntervalInMs,
239
+ resourceLocationConfig: "location"
240
+ });
241
+ await poller.poll();
242
+ return poller;
243
+ }
244
+
245
+ /**
246
+ * Create a Volume Snapshot.
247
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
248
+ * @param elasticSanName The name of the ElasticSan.
249
+ * @param volumeGroupName The name of the VolumeGroup.
250
+ * @param snapshotName The name of the volume snapshot within the given volume group.
251
+ * @param parameters Snapshot object.
252
+ * @param options The options parameters.
253
+ */
254
+ async beginCreateAndWait(
255
+ resourceGroupName: string,
256
+ elasticSanName: string,
257
+ volumeGroupName: string,
258
+ snapshotName: string,
259
+ parameters: Snapshot,
260
+ options?: VolumeSnapshotsCreateOptionalParams
261
+ ): Promise<VolumeSnapshotsCreateResponse> {
262
+ const poller = await this.beginCreate(
263
+ resourceGroupName,
264
+ elasticSanName,
265
+ volumeGroupName,
266
+ snapshotName,
267
+ parameters,
268
+ options
269
+ );
270
+ return poller.pollUntilDone();
271
+ }
272
+
273
+ /**
274
+ * Delete a Volume Snapshot.
275
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
276
+ * @param elasticSanName The name of the ElasticSan.
277
+ * @param volumeGroupName The name of the VolumeGroup.
278
+ * @param snapshotName The name of the volume snapshot within the given volume group.
279
+ * @param options The options parameters.
280
+ */
281
+ async beginDelete(
282
+ resourceGroupName: string,
283
+ elasticSanName: string,
284
+ volumeGroupName: string,
285
+ snapshotName: string,
286
+ options?: VolumeSnapshotsDeleteOptionalParams
287
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
288
+ const directSendOperation = async (
289
+ args: coreClient.OperationArguments,
290
+ spec: coreClient.OperationSpec
291
+ ): Promise<void> => {
292
+ return this.client.sendOperationRequest(args, spec);
293
+ };
294
+ const sendOperationFn = async (
295
+ args: coreClient.OperationArguments,
296
+ spec: coreClient.OperationSpec
297
+ ) => {
298
+ let currentRawResponse:
299
+ | coreClient.FullOperationResponse
300
+ | undefined = undefined;
301
+ const providedCallback = args.options?.onResponse;
302
+ const callback: coreClient.RawResponseCallback = (
303
+ rawResponse: coreClient.FullOperationResponse,
304
+ flatResponse: unknown
305
+ ) => {
306
+ currentRawResponse = rawResponse;
307
+ providedCallback?.(rawResponse, flatResponse);
308
+ };
309
+ const updatedArgs = {
310
+ ...args,
311
+ options: {
312
+ ...args.options,
313
+ onResponse: callback
314
+ }
315
+ };
316
+ const flatResponse = await directSendOperation(updatedArgs, spec);
317
+ return {
318
+ flatResponse,
319
+ rawResponse: {
320
+ statusCode: currentRawResponse!.status,
321
+ body: currentRawResponse!.parsedBody,
322
+ headers: currentRawResponse!.headers.toJSON()
323
+ }
324
+ };
325
+ };
326
+
327
+ const lro = createLroSpec({
328
+ sendOperationFn,
329
+ args: {
330
+ resourceGroupName,
331
+ elasticSanName,
332
+ volumeGroupName,
333
+ snapshotName,
334
+ options
335
+ },
336
+ spec: deleteOperationSpec
337
+ });
338
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
339
+ restoreFrom: options?.resumeFrom,
340
+ intervalInMs: options?.updateIntervalInMs,
341
+ resourceLocationConfig: "location"
342
+ });
343
+ await poller.poll();
344
+ return poller;
345
+ }
346
+
347
+ /**
348
+ * Delete a Volume Snapshot.
349
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
350
+ * @param elasticSanName The name of the ElasticSan.
351
+ * @param volumeGroupName The name of the VolumeGroup.
352
+ * @param snapshotName The name of the volume snapshot within the given volume group.
353
+ * @param options The options parameters.
354
+ */
355
+ async beginDeleteAndWait(
356
+ resourceGroupName: string,
357
+ elasticSanName: string,
358
+ volumeGroupName: string,
359
+ snapshotName: string,
360
+ options?: VolumeSnapshotsDeleteOptionalParams
361
+ ): Promise<void> {
362
+ const poller = await this.beginDelete(
363
+ resourceGroupName,
364
+ elasticSanName,
365
+ volumeGroupName,
366
+ snapshotName,
367
+ options
368
+ );
369
+ return poller.pollUntilDone();
370
+ }
371
+
372
+ /**
373
+ * Get a Volume Snapshot.
374
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
375
+ * @param elasticSanName The name of the ElasticSan.
376
+ * @param volumeGroupName The name of the VolumeGroup.
377
+ * @param snapshotName The name of the volume snapshot within the given volume group.
378
+ * @param options The options parameters.
379
+ */
380
+ get(
381
+ resourceGroupName: string,
382
+ elasticSanName: string,
383
+ volumeGroupName: string,
384
+ snapshotName: string,
385
+ options?: VolumeSnapshotsGetOptionalParams
386
+ ): Promise<VolumeSnapshotsGetResponse> {
387
+ return this.client.sendOperationRequest(
388
+ {
389
+ resourceGroupName,
390
+ elasticSanName,
391
+ volumeGroupName,
392
+ snapshotName,
393
+ options
394
+ },
395
+ getOperationSpec
396
+ );
397
+ }
398
+
399
+ /**
400
+ * ListByVolumeGroupNext
401
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
402
+ * @param elasticSanName The name of the ElasticSan.
403
+ * @param volumeGroupName The name of the VolumeGroup.
404
+ * @param nextLink The nextLink from the previous successful call to the ListByVolumeGroup method.
405
+ * @param options The options parameters.
406
+ */
407
+ private _listByVolumeGroupNext(
408
+ resourceGroupName: string,
409
+ elasticSanName: string,
410
+ volumeGroupName: string,
411
+ nextLink: string,
412
+ options?: VolumeSnapshotsListByVolumeGroupNextOptionalParams
413
+ ): Promise<VolumeSnapshotsListByVolumeGroupNextResponse> {
414
+ return this.client.sendOperationRequest(
415
+ { resourceGroupName, elasticSanName, volumeGroupName, nextLink, options },
416
+ listByVolumeGroupNextOperationSpec
417
+ );
418
+ }
419
+ }
420
+ // Operation Specifications
421
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
422
+
423
+ const listByVolumeGroupOperationSpec: coreClient.OperationSpec = {
424
+ path:
425
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots",
426
+ httpMethod: "GET",
427
+ responses: {
428
+ 200: {
429
+ bodyMapper: Mappers.SnapshotList
430
+ },
431
+ default: {
432
+ bodyMapper: Mappers.ErrorResponse
433
+ }
434
+ },
435
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
436
+ urlParameters: [
437
+ Parameters.$host,
438
+ Parameters.subscriptionId,
439
+ Parameters.resourceGroupName,
440
+ Parameters.elasticSanName,
441
+ Parameters.volumeGroupName
442
+ ],
443
+ headerParameters: [Parameters.accept],
444
+ serializer
445
+ };
446
+ const createOperationSpec: coreClient.OperationSpec = {
447
+ path:
448
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}",
449
+ httpMethod: "PUT",
450
+ responses: {
451
+ 200: {
452
+ bodyMapper: Mappers.Snapshot
453
+ },
454
+ 201: {
455
+ bodyMapper: Mappers.Snapshot
456
+ },
457
+ 202: {
458
+ bodyMapper: Mappers.Snapshot
459
+ },
460
+ 204: {
461
+ bodyMapper: Mappers.Snapshot
462
+ },
463
+ default: {
464
+ bodyMapper: Mappers.ErrorResponse
465
+ }
466
+ },
467
+ requestBody: Parameters.parameters7,
468
+ queryParameters: [Parameters.apiVersion],
469
+ urlParameters: [
470
+ Parameters.$host,
471
+ Parameters.subscriptionId,
472
+ Parameters.resourceGroupName,
473
+ Parameters.elasticSanName,
474
+ Parameters.volumeGroupName,
475
+ Parameters.snapshotName
476
+ ],
477
+ headerParameters: [Parameters.accept, Parameters.contentType],
478
+ mediaType: "json",
479
+ serializer
480
+ };
481
+ const deleteOperationSpec: coreClient.OperationSpec = {
482
+ path:
483
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}",
484
+ httpMethod: "DELETE",
485
+ responses: {
486
+ 200: {},
487
+ 201: {},
488
+ 202: {},
489
+ 204: {},
490
+ default: {
491
+ bodyMapper: Mappers.ErrorResponse
492
+ }
493
+ },
494
+ queryParameters: [Parameters.apiVersion],
495
+ urlParameters: [
496
+ Parameters.$host,
497
+ Parameters.subscriptionId,
498
+ Parameters.resourceGroupName,
499
+ Parameters.elasticSanName,
500
+ Parameters.volumeGroupName,
501
+ Parameters.snapshotName
502
+ ],
503
+ headerParameters: [Parameters.accept],
504
+ serializer
505
+ };
506
+ const getOperationSpec: coreClient.OperationSpec = {
507
+ path:
508
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}",
509
+ httpMethod: "GET",
510
+ responses: {
511
+ 200: {
512
+ bodyMapper: Mappers.Snapshot
513
+ },
514
+ default: {
515
+ bodyMapper: Mappers.ErrorResponse
516
+ }
517
+ },
518
+ queryParameters: [Parameters.apiVersion],
519
+ urlParameters: [
520
+ Parameters.$host,
521
+ Parameters.subscriptionId,
522
+ Parameters.resourceGroupName,
523
+ Parameters.elasticSanName,
524
+ Parameters.volumeGroupName,
525
+ Parameters.snapshotName
526
+ ],
527
+ headerParameters: [Parameters.accept],
528
+ serializer
529
+ };
530
+ const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = {
531
+ path: "{nextLink}",
532
+ httpMethod: "GET",
533
+ responses: {
534
+ 200: {
535
+ bodyMapper: Mappers.SnapshotList
536
+ },
537
+ default: {
538
+ bodyMapper: Mappers.ErrorResponse
539
+ }
540
+ },
541
+ urlParameters: [
542
+ Parameters.$host,
543
+ Parameters.subscriptionId,
544
+ Parameters.resourceGroupName,
545
+ Parameters.elasticSanName,
546
+ Parameters.nextLink,
547
+ Parameters.volumeGroupName
548
+ ],
549
+ headerParameters: [Parameters.accept],
550
+ serializer
551
+ };
@@ -628,7 +628,11 @@ const deleteOperationSpec: coreClient.OperationSpec = {
628
628
  Parameters.volumeGroupName,
629
629
  Parameters.volumeName
630
630
  ],
631
- headerParameters: [Parameters.accept],
631
+ headerParameters: [
632
+ Parameters.accept,
633
+ Parameters.xMsDeleteSnapshots,
634
+ Parameters.xMsForceDelete
635
+ ],
632
636
  serializer
633
637
  };
634
638
  const getOperationSpec: coreClient.OperationSpec = {
@@ -13,3 +13,4 @@ export * from "./volumeGroups";
13
13
  export * from "./volumes";
14
14
  export * from "./privateEndpointConnections";
15
15
  export * from "./privateLinkResources";
16
+ export * from "./volumeSnapshots";
@@ -0,0 +1,121 @@
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 { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { SimplePollerLike, OperationState } from "@azure/core-lro";
11
+ import {
12
+ Snapshot,
13
+ VolumeSnapshotsListByVolumeGroupOptionalParams,
14
+ VolumeSnapshotsCreateOptionalParams,
15
+ VolumeSnapshotsCreateResponse,
16
+ VolumeSnapshotsDeleteOptionalParams,
17
+ VolumeSnapshotsGetOptionalParams,
18
+ VolumeSnapshotsGetResponse
19
+ } from "../models";
20
+
21
+ /// <reference lib="esnext.asynciterable" />
22
+ /** Interface representing a VolumeSnapshots. */
23
+ export interface VolumeSnapshots {
24
+ /**
25
+ * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter
26
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
27
+ * @param elasticSanName The name of the ElasticSan.
28
+ * @param volumeGroupName The name of the VolumeGroup.
29
+ * @param options The options parameters.
30
+ */
31
+ listByVolumeGroup(
32
+ resourceGroupName: string,
33
+ elasticSanName: string,
34
+ volumeGroupName: string,
35
+ options?: VolumeSnapshotsListByVolumeGroupOptionalParams
36
+ ): PagedAsyncIterableIterator<Snapshot>;
37
+ /**
38
+ * Create a Volume Snapshot.
39
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
40
+ * @param elasticSanName The name of the ElasticSan.
41
+ * @param volumeGroupName The name of the VolumeGroup.
42
+ * @param snapshotName The name of the volume snapshot within the given volume group.
43
+ * @param parameters Snapshot object.
44
+ * @param options The options parameters.
45
+ */
46
+ beginCreate(
47
+ resourceGroupName: string,
48
+ elasticSanName: string,
49
+ volumeGroupName: string,
50
+ snapshotName: string,
51
+ parameters: Snapshot,
52
+ options?: VolumeSnapshotsCreateOptionalParams
53
+ ): Promise<
54
+ SimplePollerLike<
55
+ OperationState<VolumeSnapshotsCreateResponse>,
56
+ VolumeSnapshotsCreateResponse
57
+ >
58
+ >;
59
+ /**
60
+ * Create a Volume Snapshot.
61
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
62
+ * @param elasticSanName The name of the ElasticSan.
63
+ * @param volumeGroupName The name of the VolumeGroup.
64
+ * @param snapshotName The name of the volume snapshot within the given volume group.
65
+ * @param parameters Snapshot object.
66
+ * @param options The options parameters.
67
+ */
68
+ beginCreateAndWait(
69
+ resourceGroupName: string,
70
+ elasticSanName: string,
71
+ volumeGroupName: string,
72
+ snapshotName: string,
73
+ parameters: Snapshot,
74
+ options?: VolumeSnapshotsCreateOptionalParams
75
+ ): Promise<VolumeSnapshotsCreateResponse>;
76
+ /**
77
+ * Delete a Volume Snapshot.
78
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
79
+ * @param elasticSanName The name of the ElasticSan.
80
+ * @param volumeGroupName The name of the VolumeGroup.
81
+ * @param snapshotName The name of the volume snapshot within the given volume group.
82
+ * @param options The options parameters.
83
+ */
84
+ beginDelete(
85
+ resourceGroupName: string,
86
+ elasticSanName: string,
87
+ volumeGroupName: string,
88
+ snapshotName: string,
89
+ options?: VolumeSnapshotsDeleteOptionalParams
90
+ ): Promise<SimplePollerLike<OperationState<void>, void>>;
91
+ /**
92
+ * Delete a Volume Snapshot.
93
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
94
+ * @param elasticSanName The name of the ElasticSan.
95
+ * @param volumeGroupName The name of the VolumeGroup.
96
+ * @param snapshotName The name of the volume snapshot within the given volume group.
97
+ * @param options The options parameters.
98
+ */
99
+ beginDeleteAndWait(
100
+ resourceGroupName: string,
101
+ elasticSanName: string,
102
+ volumeGroupName: string,
103
+ snapshotName: string,
104
+ options?: VolumeSnapshotsDeleteOptionalParams
105
+ ): Promise<void>;
106
+ /**
107
+ * Get a Volume Snapshot.
108
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
109
+ * @param elasticSanName The name of the ElasticSan.
110
+ * @param volumeGroupName The name of the VolumeGroup.
111
+ * @param snapshotName The name of the volume snapshot within the given volume group.
112
+ * @param options The options parameters.
113
+ */
114
+ get(
115
+ resourceGroupName: string,
116
+ elasticSanName: string,
117
+ volumeGroupName: string,
118
+ snapshotName: string,
119
+ options?: VolumeSnapshotsGetOptionalParams
120
+ ): Promise<VolumeSnapshotsGetResponse>;
121
+ }