@azure/arm-elasticsan 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/index.js +2897 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/samples-dev/elasticSansCreateSample.d.ts +2 -0
- package/dist-esm/samples-dev/elasticSansCreateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/elasticSansCreateSample.js +62 -0
- package/dist-esm/samples-dev/elasticSansCreateSample.js.map +1 -0
- package/dist-esm/samples-dev/elasticSansDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/elasticSansDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/elasticSansDeleteSample.js +49 -0
- package/dist-esm/samples-dev/elasticSansDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/elasticSansGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/elasticSansGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/elasticSansGetSample.js +49 -0
- package/dist-esm/samples-dev/elasticSansGetSample.js.map +1 -0
- package/dist-esm/samples-dev/elasticSansListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/elasticSansListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/elasticSansListByResourceGroupSample.js +75 -0
- package/dist-esm/samples-dev/elasticSansListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/elasticSansListBySubscriptionSample.d.ts +2 -0
- package/dist-esm/samples-dev/elasticSansListBySubscriptionSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/elasticSansListBySubscriptionSample.js +73 -0
- package/dist-esm/samples-dev/elasticSansListBySubscriptionSample.js.map +1 -0
- package/dist-esm/samples-dev/elasticSansUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/elasticSansUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/elasticSansUpdateSample.js +55 -0
- package/dist-esm/samples-dev/elasticSansUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.js +73 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/samples-dev/skusListSample.d.ts +2 -0
- package/dist-esm/samples-dev/skusListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/skusListSample.js +75 -0
- package/dist-esm/samples-dev/skusListSample.js.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsCreateSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumeGroupsCreateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsCreateSample.js +62 -0
- package/dist-esm/samples-dev/volumeGroupsCreateSample.js.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumeGroupsDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsDeleteSample.js +51 -0
- package/dist-esm/samples-dev/volumeGroupsDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumeGroupsGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsGetSample.js +51 -0
- package/dist-esm/samples-dev/volumeGroupsGetSample.js.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsListByElasticSanSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumeGroupsListByElasticSanSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsListByElasticSanSample.js +77 -0
- package/dist-esm/samples-dev/volumeGroupsListByElasticSanSample.js.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumeGroupsUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumeGroupsUpdateSample.js +62 -0
- package/dist-esm/samples-dev/volumeGroupsUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/volumesCreateSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumesCreateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumesCreateSample.js +59 -0
- package/dist-esm/samples-dev/volumesCreateSample.js.map +1 -0
- package/dist-esm/samples-dev/volumesDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumesDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumesDeleteSample.js +53 -0
- package/dist-esm/samples-dev/volumesDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/volumesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumesGetSample.js +53 -0
- package/dist-esm/samples-dev/volumesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/volumesListByVolumeGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumesListByVolumeGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumesListByVolumeGroupSample.js +79 -0
- package/dist-esm/samples-dev/volumesListByVolumeGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/volumesUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/volumesUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/volumesUpdateSample.js +58 -0
- package/dist-esm/samples-dev/volumesUpdateSample.js.map +1 -0
- package/dist-esm/src/elasticSanManagement.d.ts +24 -0
- package/dist-esm/src/elasticSanManagement.d.ts.map +1 -0
- package/dist-esm/src/elasticSanManagement.js +107 -0
- package/dist-esm/src/elasticSanManagement.js.map +1 -0
- package/dist-esm/src/index.d.ts +5 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +12 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/lroImpl.d.ts +16 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +29 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +691 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +88 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +29 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +877 -0
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +19 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +170 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/elasticSans.d.ts +107 -0
- package/dist-esm/src/operations/elasticSans.d.ts.map +1 -0
- package/dist-esm/src/operations/elasticSans.js +509 -0
- package/dist-esm/src/operations/elasticSans.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +6 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +13 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +26 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +90 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operations/skus.d.ts +26 -0
- package/dist-esm/src/operations/skus.d.ts.map +1 -0
- package/dist-esm/src/operations/skus.js +90 -0
- package/dist-esm/src/operations/skus.js.map +1 -0
- package/dist-esm/src/operations/volumeGroups.d.ts +99 -0
- package/dist-esm/src/operations/volumeGroups.d.ts.map +1 -0
- package/dist-esm/src/operations/volumeGroups.js +438 -0
- package/dist-esm/src/operations/volumeGroups.js.map +1 -0
- package/dist-esm/src/operations/volumes.d.ts +109 -0
- package/dist-esm/src/operations/volumes.d.ts.map +1 -0
- package/dist-esm/src/operations/volumes.js +468 -0
- package/dist-esm/src/operations/volumes.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/elasticSans.d.ts +71 -0
- package/dist-esm/src/operationsInterfaces/elasticSans.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/elasticSans.js +9 -0
- package/dist-esm/src/operationsInterfaces/elasticSans.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +13 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/skus.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/skus.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/skus.js +9 -0
- package/dist-esm/src/operationsInterfaces/skus.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/volumeGroups.d.ts +74 -0
- package/dist-esm/src/operationsInterfaces/volumeGroups.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/volumeGroups.js +9 -0
- package/dist-esm/src/operationsInterfaces/volumeGroups.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/volumes.d.ts +82 -0
- package/dist-esm/src/operationsInterfaces/volumes.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/volumes.js +9 -0
- package/dist-esm/src/operationsInterfaces/volumes.js.map +1 -0
- package/dist-esm/test/elasticsan_examples.spec.d.ts +4 -0
- package/dist-esm/test/elasticsan_examples.spec.d.ts.map +1 -0
- package/dist-esm/test/elasticsan_examples.spec.js +80 -0
- package/dist-esm/test/elasticsan_examples.spec.js.map +1 -0
- package/package.json +122 -0
- package/review/arm-elasticsan.api.md +536 -0
- package/rollup.config.js +122 -0
- package/src/elasticSanManagement.ts +161 -0
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +787 -0
- package/src/models/mappers.ts +935 -0
- package/src/models/parameters.ts +199 -0
- package/src/operations/elasticSans.ts +683 -0
- package/src/operations/index.ts +13 -0
- package/src/operations/operations.ts +98 -0
- package/src/operations/skus.ts +96 -0
- package/src/operations/volumeGroups.ts +629 -0
- package/src/operations/volumes.ts +673 -0
- package/src/operationsInterfaces/elasticSans.ts +139 -0
- package/src/operationsInterfaces/index.ts +13 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/skus.ts +22 -0
- package/src/operationsInterfaces/volumeGroups.ts +147 -0
- package/src/operationsInterfaces/volumes.ts +157 -0
- package/tsconfig.json +33 -0
- package/types/arm-elasticsan.d.ts +1036 -0
- package/types/tsdoc-metadata.json +11 -0
|
@@ -0,0 +1,629 @@
|
|
|
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 { VolumeGroups } from "../operationsInterfaces";
|
|
11
|
+
import * as coreClient from "@azure/core-client";
|
|
12
|
+
import * as Mappers from "../models/mappers";
|
|
13
|
+
import * as Parameters from "../models/parameters";
|
|
14
|
+
import { ElasticSanManagement } from "../elasticSanManagement";
|
|
15
|
+
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
|
16
|
+
import { LroImpl } from "../lroImpl";
|
|
17
|
+
import {
|
|
18
|
+
VolumeGroup,
|
|
19
|
+
VolumeGroupsListByElasticSanNextOptionalParams,
|
|
20
|
+
VolumeGroupsListByElasticSanOptionalParams,
|
|
21
|
+
VolumeGroupsListByElasticSanResponse,
|
|
22
|
+
VolumeGroupsCreateOptionalParams,
|
|
23
|
+
VolumeGroupsCreateResponse,
|
|
24
|
+
VolumeGroupUpdate,
|
|
25
|
+
VolumeGroupsUpdateOptionalParams,
|
|
26
|
+
VolumeGroupsUpdateResponse,
|
|
27
|
+
VolumeGroupsDeleteOptionalParams,
|
|
28
|
+
VolumeGroupsGetOptionalParams,
|
|
29
|
+
VolumeGroupsGetResponse,
|
|
30
|
+
VolumeGroupsListByElasticSanNextResponse
|
|
31
|
+
} from "../models";
|
|
32
|
+
|
|
33
|
+
/// <reference lib="esnext.asynciterable" />
|
|
34
|
+
/** Class containing VolumeGroups operations. */
|
|
35
|
+
export class VolumeGroupsImpl implements VolumeGroups {
|
|
36
|
+
private readonly client: ElasticSanManagement;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Initialize a new instance of the class VolumeGroups class.
|
|
40
|
+
* @param client Reference to the service client
|
|
41
|
+
*/
|
|
42
|
+
constructor(client: ElasticSanManagement) {
|
|
43
|
+
this.client = client;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* List VolumeGroups.
|
|
48
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
49
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
50
|
+
* @param options The options parameters.
|
|
51
|
+
*/
|
|
52
|
+
public listByElasticSan(
|
|
53
|
+
resourceGroupName: string,
|
|
54
|
+
elasticSanName: string,
|
|
55
|
+
options?: VolumeGroupsListByElasticSanOptionalParams
|
|
56
|
+
): PagedAsyncIterableIterator<VolumeGroup> {
|
|
57
|
+
const iter = this.listByElasticSanPagingAll(
|
|
58
|
+
resourceGroupName,
|
|
59
|
+
elasticSanName,
|
|
60
|
+
options
|
|
61
|
+
);
|
|
62
|
+
return {
|
|
63
|
+
next() {
|
|
64
|
+
return iter.next();
|
|
65
|
+
},
|
|
66
|
+
[Symbol.asyncIterator]() {
|
|
67
|
+
return this;
|
|
68
|
+
},
|
|
69
|
+
byPage: () => {
|
|
70
|
+
return this.listByElasticSanPagingPage(
|
|
71
|
+
resourceGroupName,
|
|
72
|
+
elasticSanName,
|
|
73
|
+
options
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
private async *listByElasticSanPagingPage(
|
|
80
|
+
resourceGroupName: string,
|
|
81
|
+
elasticSanName: string,
|
|
82
|
+
options?: VolumeGroupsListByElasticSanOptionalParams
|
|
83
|
+
): AsyncIterableIterator<VolumeGroup[]> {
|
|
84
|
+
let result = await this._listByElasticSan(
|
|
85
|
+
resourceGroupName,
|
|
86
|
+
elasticSanName,
|
|
87
|
+
options
|
|
88
|
+
);
|
|
89
|
+
yield result.value || [];
|
|
90
|
+
let continuationToken = result.nextLink;
|
|
91
|
+
while (continuationToken) {
|
|
92
|
+
result = await this._listByElasticSanNext(
|
|
93
|
+
resourceGroupName,
|
|
94
|
+
elasticSanName,
|
|
95
|
+
continuationToken,
|
|
96
|
+
options
|
|
97
|
+
);
|
|
98
|
+
continuationToken = result.nextLink;
|
|
99
|
+
yield result.value || [];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private async *listByElasticSanPagingAll(
|
|
104
|
+
resourceGroupName: string,
|
|
105
|
+
elasticSanName: string,
|
|
106
|
+
options?: VolumeGroupsListByElasticSanOptionalParams
|
|
107
|
+
): AsyncIterableIterator<VolumeGroup> {
|
|
108
|
+
for await (const page of this.listByElasticSanPagingPage(
|
|
109
|
+
resourceGroupName,
|
|
110
|
+
elasticSanName,
|
|
111
|
+
options
|
|
112
|
+
)) {
|
|
113
|
+
yield* page;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* List VolumeGroups.
|
|
119
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
120
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
121
|
+
* @param options The options parameters.
|
|
122
|
+
*/
|
|
123
|
+
private _listByElasticSan(
|
|
124
|
+
resourceGroupName: string,
|
|
125
|
+
elasticSanName: string,
|
|
126
|
+
options?: VolumeGroupsListByElasticSanOptionalParams
|
|
127
|
+
): Promise<VolumeGroupsListByElasticSanResponse> {
|
|
128
|
+
return this.client.sendOperationRequest(
|
|
129
|
+
{ resourceGroupName, elasticSanName, options },
|
|
130
|
+
listByElasticSanOperationSpec
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Create a Volume Group.
|
|
136
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
137
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
138
|
+
* @param volumeGroupName The name of the VolumeGroup.
|
|
139
|
+
* @param parameters Volume Group object.
|
|
140
|
+
* @param options The options parameters.
|
|
141
|
+
*/
|
|
142
|
+
async beginCreate(
|
|
143
|
+
resourceGroupName: string,
|
|
144
|
+
elasticSanName: string,
|
|
145
|
+
volumeGroupName: string,
|
|
146
|
+
parameters: VolumeGroup,
|
|
147
|
+
options?: VolumeGroupsCreateOptionalParams
|
|
148
|
+
): Promise<
|
|
149
|
+
PollerLike<
|
|
150
|
+
PollOperationState<VolumeGroupsCreateResponse>,
|
|
151
|
+
VolumeGroupsCreateResponse
|
|
152
|
+
>
|
|
153
|
+
> {
|
|
154
|
+
const directSendOperation = async (
|
|
155
|
+
args: coreClient.OperationArguments,
|
|
156
|
+
spec: coreClient.OperationSpec
|
|
157
|
+
): Promise<VolumeGroupsCreateResponse> => {
|
|
158
|
+
return this.client.sendOperationRequest(args, spec);
|
|
159
|
+
};
|
|
160
|
+
const sendOperation = async (
|
|
161
|
+
args: coreClient.OperationArguments,
|
|
162
|
+
spec: coreClient.OperationSpec
|
|
163
|
+
) => {
|
|
164
|
+
let currentRawResponse:
|
|
165
|
+
| coreClient.FullOperationResponse
|
|
166
|
+
| undefined = undefined;
|
|
167
|
+
const providedCallback = args.options?.onResponse;
|
|
168
|
+
const callback: coreClient.RawResponseCallback = (
|
|
169
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
170
|
+
flatResponse: unknown
|
|
171
|
+
) => {
|
|
172
|
+
currentRawResponse = rawResponse;
|
|
173
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
174
|
+
};
|
|
175
|
+
const updatedArgs = {
|
|
176
|
+
...args,
|
|
177
|
+
options: {
|
|
178
|
+
...args.options,
|
|
179
|
+
onResponse: callback
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
183
|
+
return {
|
|
184
|
+
flatResponse,
|
|
185
|
+
rawResponse: {
|
|
186
|
+
statusCode: currentRawResponse!.status,
|
|
187
|
+
body: currentRawResponse!.parsedBody,
|
|
188
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const lro = new LroImpl(
|
|
194
|
+
sendOperation,
|
|
195
|
+
{
|
|
196
|
+
resourceGroupName,
|
|
197
|
+
elasticSanName,
|
|
198
|
+
volumeGroupName,
|
|
199
|
+
parameters,
|
|
200
|
+
options
|
|
201
|
+
},
|
|
202
|
+
createOperationSpec
|
|
203
|
+
);
|
|
204
|
+
const poller = new LroEngine(lro, {
|
|
205
|
+
resumeFrom: options?.resumeFrom,
|
|
206
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
207
|
+
lroResourceLocationConfig: "azure-async-operation"
|
|
208
|
+
});
|
|
209
|
+
await poller.poll();
|
|
210
|
+
return poller;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Create a Volume Group.
|
|
215
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
216
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
217
|
+
* @param volumeGroupName The name of the VolumeGroup.
|
|
218
|
+
* @param parameters Volume Group object.
|
|
219
|
+
* @param options The options parameters.
|
|
220
|
+
*/
|
|
221
|
+
async beginCreateAndWait(
|
|
222
|
+
resourceGroupName: string,
|
|
223
|
+
elasticSanName: string,
|
|
224
|
+
volumeGroupName: string,
|
|
225
|
+
parameters: VolumeGroup,
|
|
226
|
+
options?: VolumeGroupsCreateOptionalParams
|
|
227
|
+
): Promise<VolumeGroupsCreateResponse> {
|
|
228
|
+
const poller = await this.beginCreate(
|
|
229
|
+
resourceGroupName,
|
|
230
|
+
elasticSanName,
|
|
231
|
+
volumeGroupName,
|
|
232
|
+
parameters,
|
|
233
|
+
options
|
|
234
|
+
);
|
|
235
|
+
return poller.pollUntilDone();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Update an VolumeGroup.
|
|
240
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
241
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
242
|
+
* @param volumeGroupName The name of the VolumeGroup.
|
|
243
|
+
* @param parameters Volume Group object.
|
|
244
|
+
* @param options The options parameters.
|
|
245
|
+
*/
|
|
246
|
+
async beginUpdate(
|
|
247
|
+
resourceGroupName: string,
|
|
248
|
+
elasticSanName: string,
|
|
249
|
+
volumeGroupName: string,
|
|
250
|
+
parameters: VolumeGroupUpdate,
|
|
251
|
+
options?: VolumeGroupsUpdateOptionalParams
|
|
252
|
+
): Promise<
|
|
253
|
+
PollerLike<
|
|
254
|
+
PollOperationState<VolumeGroupsUpdateResponse>,
|
|
255
|
+
VolumeGroupsUpdateResponse
|
|
256
|
+
>
|
|
257
|
+
> {
|
|
258
|
+
const directSendOperation = async (
|
|
259
|
+
args: coreClient.OperationArguments,
|
|
260
|
+
spec: coreClient.OperationSpec
|
|
261
|
+
): Promise<VolumeGroupsUpdateResponse> => {
|
|
262
|
+
return this.client.sendOperationRequest(args, spec);
|
|
263
|
+
};
|
|
264
|
+
const sendOperation = async (
|
|
265
|
+
args: coreClient.OperationArguments,
|
|
266
|
+
spec: coreClient.OperationSpec
|
|
267
|
+
) => {
|
|
268
|
+
let currentRawResponse:
|
|
269
|
+
| coreClient.FullOperationResponse
|
|
270
|
+
| undefined = undefined;
|
|
271
|
+
const providedCallback = args.options?.onResponse;
|
|
272
|
+
const callback: coreClient.RawResponseCallback = (
|
|
273
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
274
|
+
flatResponse: unknown
|
|
275
|
+
) => {
|
|
276
|
+
currentRawResponse = rawResponse;
|
|
277
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
278
|
+
};
|
|
279
|
+
const updatedArgs = {
|
|
280
|
+
...args,
|
|
281
|
+
options: {
|
|
282
|
+
...args.options,
|
|
283
|
+
onResponse: callback
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
287
|
+
return {
|
|
288
|
+
flatResponse,
|
|
289
|
+
rawResponse: {
|
|
290
|
+
statusCode: currentRawResponse!.status,
|
|
291
|
+
body: currentRawResponse!.parsedBody,
|
|
292
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
const lro = new LroImpl(
|
|
298
|
+
sendOperation,
|
|
299
|
+
{
|
|
300
|
+
resourceGroupName,
|
|
301
|
+
elasticSanName,
|
|
302
|
+
volumeGroupName,
|
|
303
|
+
parameters,
|
|
304
|
+
options
|
|
305
|
+
},
|
|
306
|
+
updateOperationSpec
|
|
307
|
+
);
|
|
308
|
+
const poller = new LroEngine(lro, {
|
|
309
|
+
resumeFrom: options?.resumeFrom,
|
|
310
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
311
|
+
lroResourceLocationConfig: "azure-async-operation"
|
|
312
|
+
});
|
|
313
|
+
await poller.poll();
|
|
314
|
+
return poller;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Update an VolumeGroup.
|
|
319
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
320
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
321
|
+
* @param volumeGroupName The name of the VolumeGroup.
|
|
322
|
+
* @param parameters Volume Group object.
|
|
323
|
+
* @param options The options parameters.
|
|
324
|
+
*/
|
|
325
|
+
async beginUpdateAndWait(
|
|
326
|
+
resourceGroupName: string,
|
|
327
|
+
elasticSanName: string,
|
|
328
|
+
volumeGroupName: string,
|
|
329
|
+
parameters: VolumeGroupUpdate,
|
|
330
|
+
options?: VolumeGroupsUpdateOptionalParams
|
|
331
|
+
): Promise<VolumeGroupsUpdateResponse> {
|
|
332
|
+
const poller = await this.beginUpdate(
|
|
333
|
+
resourceGroupName,
|
|
334
|
+
elasticSanName,
|
|
335
|
+
volumeGroupName,
|
|
336
|
+
parameters,
|
|
337
|
+
options
|
|
338
|
+
);
|
|
339
|
+
return poller.pollUntilDone();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Delete an VolumeGroup.
|
|
344
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
345
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
346
|
+
* @param volumeGroupName The name of the VolumeGroup.
|
|
347
|
+
* @param options The options parameters.
|
|
348
|
+
*/
|
|
349
|
+
async beginDelete(
|
|
350
|
+
resourceGroupName: string,
|
|
351
|
+
elasticSanName: string,
|
|
352
|
+
volumeGroupName: string,
|
|
353
|
+
options?: VolumeGroupsDeleteOptionalParams
|
|
354
|
+
): Promise<PollerLike<PollOperationState<void>, void>> {
|
|
355
|
+
const directSendOperation = async (
|
|
356
|
+
args: coreClient.OperationArguments,
|
|
357
|
+
spec: coreClient.OperationSpec
|
|
358
|
+
): Promise<void> => {
|
|
359
|
+
return this.client.sendOperationRequest(args, spec);
|
|
360
|
+
};
|
|
361
|
+
const sendOperation = async (
|
|
362
|
+
args: coreClient.OperationArguments,
|
|
363
|
+
spec: coreClient.OperationSpec
|
|
364
|
+
) => {
|
|
365
|
+
let currentRawResponse:
|
|
366
|
+
| coreClient.FullOperationResponse
|
|
367
|
+
| undefined = undefined;
|
|
368
|
+
const providedCallback = args.options?.onResponse;
|
|
369
|
+
const callback: coreClient.RawResponseCallback = (
|
|
370
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
371
|
+
flatResponse: unknown
|
|
372
|
+
) => {
|
|
373
|
+
currentRawResponse = rawResponse;
|
|
374
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
375
|
+
};
|
|
376
|
+
const updatedArgs = {
|
|
377
|
+
...args,
|
|
378
|
+
options: {
|
|
379
|
+
...args.options,
|
|
380
|
+
onResponse: callback
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
384
|
+
return {
|
|
385
|
+
flatResponse,
|
|
386
|
+
rawResponse: {
|
|
387
|
+
statusCode: currentRawResponse!.status,
|
|
388
|
+
body: currentRawResponse!.parsedBody,
|
|
389
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
const lro = new LroImpl(
|
|
395
|
+
sendOperation,
|
|
396
|
+
{ resourceGroupName, elasticSanName, volumeGroupName, options },
|
|
397
|
+
deleteOperationSpec
|
|
398
|
+
);
|
|
399
|
+
const poller = new LroEngine(lro, {
|
|
400
|
+
resumeFrom: options?.resumeFrom,
|
|
401
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
402
|
+
lroResourceLocationConfig: "azure-async-operation"
|
|
403
|
+
});
|
|
404
|
+
await poller.poll();
|
|
405
|
+
return poller;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Delete an VolumeGroup.
|
|
410
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
411
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
412
|
+
* @param volumeGroupName The name of the VolumeGroup.
|
|
413
|
+
* @param options The options parameters.
|
|
414
|
+
*/
|
|
415
|
+
async beginDeleteAndWait(
|
|
416
|
+
resourceGroupName: string,
|
|
417
|
+
elasticSanName: string,
|
|
418
|
+
volumeGroupName: string,
|
|
419
|
+
options?: VolumeGroupsDeleteOptionalParams
|
|
420
|
+
): Promise<void> {
|
|
421
|
+
const poller = await this.beginDelete(
|
|
422
|
+
resourceGroupName,
|
|
423
|
+
elasticSanName,
|
|
424
|
+
volumeGroupName,
|
|
425
|
+
options
|
|
426
|
+
);
|
|
427
|
+
return poller.pollUntilDone();
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Get an VolumeGroups.
|
|
432
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
433
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
434
|
+
* @param volumeGroupName The name of the VolumeGroup.
|
|
435
|
+
* @param options The options parameters.
|
|
436
|
+
*/
|
|
437
|
+
get(
|
|
438
|
+
resourceGroupName: string,
|
|
439
|
+
elasticSanName: string,
|
|
440
|
+
volumeGroupName: string,
|
|
441
|
+
options?: VolumeGroupsGetOptionalParams
|
|
442
|
+
): Promise<VolumeGroupsGetResponse> {
|
|
443
|
+
return this.client.sendOperationRequest(
|
|
444
|
+
{ resourceGroupName, elasticSanName, volumeGroupName, options },
|
|
445
|
+
getOperationSpec
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* ListByElasticSanNext
|
|
451
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
452
|
+
* @param elasticSanName The name of the ElasticSan.
|
|
453
|
+
* @param nextLink The nextLink from the previous successful call to the ListByElasticSan method.
|
|
454
|
+
* @param options The options parameters.
|
|
455
|
+
*/
|
|
456
|
+
private _listByElasticSanNext(
|
|
457
|
+
resourceGroupName: string,
|
|
458
|
+
elasticSanName: string,
|
|
459
|
+
nextLink: string,
|
|
460
|
+
options?: VolumeGroupsListByElasticSanNextOptionalParams
|
|
461
|
+
): Promise<VolumeGroupsListByElasticSanNextResponse> {
|
|
462
|
+
return this.client.sendOperationRequest(
|
|
463
|
+
{ resourceGroupName, elasticSanName, nextLink, options },
|
|
464
|
+
listByElasticSanNextOperationSpec
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
// Operation Specifications
|
|
469
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
470
|
+
|
|
471
|
+
const listByElasticSanOperationSpec: coreClient.OperationSpec = {
|
|
472
|
+
path:
|
|
473
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumeGroups",
|
|
474
|
+
httpMethod: "GET",
|
|
475
|
+
responses: {
|
|
476
|
+
200: {
|
|
477
|
+
bodyMapper: Mappers.VolumeGroupList
|
|
478
|
+
},
|
|
479
|
+
default: {
|
|
480
|
+
bodyMapper: Mappers.ErrorModel
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
queryParameters: [Parameters.apiVersion],
|
|
484
|
+
urlParameters: [
|
|
485
|
+
Parameters.$host,
|
|
486
|
+
Parameters.subscriptionId,
|
|
487
|
+
Parameters.resourceGroupName,
|
|
488
|
+
Parameters.elasticSanName
|
|
489
|
+
],
|
|
490
|
+
headerParameters: [Parameters.accept],
|
|
491
|
+
serializer
|
|
492
|
+
};
|
|
493
|
+
const createOperationSpec: coreClient.OperationSpec = {
|
|
494
|
+
path:
|
|
495
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}",
|
|
496
|
+
httpMethod: "PUT",
|
|
497
|
+
responses: {
|
|
498
|
+
200: {
|
|
499
|
+
bodyMapper: Mappers.VolumeGroup
|
|
500
|
+
},
|
|
501
|
+
201: {
|
|
502
|
+
bodyMapper: Mappers.VolumeGroup
|
|
503
|
+
},
|
|
504
|
+
202: {
|
|
505
|
+
bodyMapper: Mappers.VolumeGroup
|
|
506
|
+
},
|
|
507
|
+
204: {
|
|
508
|
+
bodyMapper: Mappers.VolumeGroup
|
|
509
|
+
},
|
|
510
|
+
default: {
|
|
511
|
+
bodyMapper: Mappers.ErrorModel
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
requestBody: Parameters.parameters2,
|
|
515
|
+
queryParameters: [Parameters.apiVersion],
|
|
516
|
+
urlParameters: [
|
|
517
|
+
Parameters.$host,
|
|
518
|
+
Parameters.subscriptionId,
|
|
519
|
+
Parameters.resourceGroupName,
|
|
520
|
+
Parameters.elasticSanName,
|
|
521
|
+
Parameters.volumeGroupName
|
|
522
|
+
],
|
|
523
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
524
|
+
mediaType: "json",
|
|
525
|
+
serializer
|
|
526
|
+
};
|
|
527
|
+
const updateOperationSpec: coreClient.OperationSpec = {
|
|
528
|
+
path:
|
|
529
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}",
|
|
530
|
+
httpMethod: "PATCH",
|
|
531
|
+
responses: {
|
|
532
|
+
200: {
|
|
533
|
+
bodyMapper: Mappers.VolumeGroup
|
|
534
|
+
},
|
|
535
|
+
201: {
|
|
536
|
+
bodyMapper: Mappers.VolumeGroup
|
|
537
|
+
},
|
|
538
|
+
202: {
|
|
539
|
+
bodyMapper: Mappers.VolumeGroup
|
|
540
|
+
},
|
|
541
|
+
204: {
|
|
542
|
+
bodyMapper: Mappers.VolumeGroup
|
|
543
|
+
},
|
|
544
|
+
default: {
|
|
545
|
+
bodyMapper: Mappers.ErrorModel
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
requestBody: Parameters.parameters3,
|
|
549
|
+
queryParameters: [Parameters.apiVersion],
|
|
550
|
+
urlParameters: [
|
|
551
|
+
Parameters.$host,
|
|
552
|
+
Parameters.subscriptionId,
|
|
553
|
+
Parameters.resourceGroupName,
|
|
554
|
+
Parameters.elasticSanName,
|
|
555
|
+
Parameters.volumeGroupName
|
|
556
|
+
],
|
|
557
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
558
|
+
mediaType: "json",
|
|
559
|
+
serializer
|
|
560
|
+
};
|
|
561
|
+
const deleteOperationSpec: coreClient.OperationSpec = {
|
|
562
|
+
path:
|
|
563
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}",
|
|
564
|
+
httpMethod: "DELETE",
|
|
565
|
+
responses: {
|
|
566
|
+
200: {},
|
|
567
|
+
201: {},
|
|
568
|
+
202: {},
|
|
569
|
+
204: {},
|
|
570
|
+
default: {
|
|
571
|
+
bodyMapper: Mappers.ErrorModel
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
queryParameters: [Parameters.apiVersion],
|
|
575
|
+
urlParameters: [
|
|
576
|
+
Parameters.$host,
|
|
577
|
+
Parameters.subscriptionId,
|
|
578
|
+
Parameters.resourceGroupName,
|
|
579
|
+
Parameters.elasticSanName,
|
|
580
|
+
Parameters.volumeGroupName
|
|
581
|
+
],
|
|
582
|
+
headerParameters: [Parameters.accept],
|
|
583
|
+
serializer
|
|
584
|
+
};
|
|
585
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
586
|
+
path:
|
|
587
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}",
|
|
588
|
+
httpMethod: "GET",
|
|
589
|
+
responses: {
|
|
590
|
+
200: {
|
|
591
|
+
bodyMapper: Mappers.VolumeGroup
|
|
592
|
+
},
|
|
593
|
+
default: {
|
|
594
|
+
bodyMapper: Mappers.ErrorModel
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
queryParameters: [Parameters.apiVersion],
|
|
598
|
+
urlParameters: [
|
|
599
|
+
Parameters.$host,
|
|
600
|
+
Parameters.subscriptionId,
|
|
601
|
+
Parameters.resourceGroupName,
|
|
602
|
+
Parameters.elasticSanName,
|
|
603
|
+
Parameters.volumeGroupName
|
|
604
|
+
],
|
|
605
|
+
headerParameters: [Parameters.accept],
|
|
606
|
+
serializer
|
|
607
|
+
};
|
|
608
|
+
const listByElasticSanNextOperationSpec: coreClient.OperationSpec = {
|
|
609
|
+
path: "{nextLink}",
|
|
610
|
+
httpMethod: "GET",
|
|
611
|
+
responses: {
|
|
612
|
+
200: {
|
|
613
|
+
bodyMapper: Mappers.VolumeGroupList
|
|
614
|
+
},
|
|
615
|
+
default: {
|
|
616
|
+
bodyMapper: Mappers.ErrorModel
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
queryParameters: [Parameters.apiVersion],
|
|
620
|
+
urlParameters: [
|
|
621
|
+
Parameters.$host,
|
|
622
|
+
Parameters.subscriptionId,
|
|
623
|
+
Parameters.resourceGroupName,
|
|
624
|
+
Parameters.elasticSanName,
|
|
625
|
+
Parameters.nextLink
|
|
626
|
+
],
|
|
627
|
+
headerParameters: [Parameters.accept],
|
|
628
|
+
serializer
|
|
629
|
+
};
|