@azure/arm-storageimportexport 0.1.0 → 2.0.0
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 +11 -0
- package/LICENSE +21 -0
- package/README.md +75 -73
- package/dist/index.js +1999 -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/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/models/index.d.ts +504 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +40 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +25 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +570 -422
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +17 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/parameters.js +79 -49
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/bitLockerKeys.d.ts +32 -0
- package/dist-esm/src/operations/bitLockerKeys.d.ts.map +1 -0
- package/dist-esm/src/operations/bitLockerKeys.js +101 -0
- package/dist-esm/src/operations/bitLockerKeys.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/{esm → dist-esm/src}/operations/index.js +3 -5
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/jobs.d.ts +92 -0
- package/dist-esm/src/operations/jobs.d.ts.map +1 -0
- package/dist-esm/src/operations/jobs.js +376 -0
- package/dist-esm/src/operations/jobs.js.map +1 -0
- package/dist-esm/src/operations/locations.d.ts +35 -0
- package/dist-esm/src/operations/locations.d.ts.map +1 -0
- package/dist-esm/src/operations/locations.js +117 -0
- package/dist-esm/src/operations/locations.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/operationsInterfaces/bitLockerKeys.d.ts +14 -0
- package/dist-esm/src/operationsInterfaces/bitLockerKeys.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/bitLockerKeys.js +9 -0
- package/dist-esm/src/operationsInterfaces/bitLockerKeys.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +5 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +12 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/jobs.d.ts +54 -0
- package/dist-esm/src/operationsInterfaces/jobs.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/jobs.js +9 -0
- package/dist-esm/src/operationsInterfaces/jobs.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/locations.d.ts +19 -0
- package/dist-esm/src/operationsInterfaces/locations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/locations.js +9 -0
- package/dist-esm/src/operationsInterfaces/locations.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/storageImportExport.d.ts +22 -0
- package/dist-esm/src/storageImportExport.d.ts.map +1 -0
- package/dist-esm/src/storageImportExport.js +54 -0
- package/dist-esm/src/storageImportExport.js.map +1 -0
- package/dist-esm/test/sampleTest.d.ts +2 -0
- package/dist-esm/test/sampleTest.d.ts.map +1 -0
- package/dist-esm/test/sampleTest.js +40 -0
- package/dist-esm/test/sampleTest.js.map +1 -0
- package/package.json +87 -26
- package/review/arm-storageimportexport.api.md +438 -0
- package/rollup.config.js +184 -27
- package/src/index.ts +12 -0
- package/src/models/index.ts +568 -0
- package/{lib → src}/models/mappers.ts +575 -424
- package/src/models/parameters.ts +171 -0
- package/src/operations/bitLockerKeys.ts +125 -0
- package/{lib → src}/operations/index.ts +3 -5
- package/src/operations/jobs.ts +467 -0
- package/src/operations/locations.ts +134 -0
- package/src/operations/operations.ts +98 -0
- package/src/operationsInterfaces/bitLockerKeys.ts +27 -0
- package/src/operationsInterfaces/index.ts +12 -0
- package/src/operationsInterfaces/jobs.ts +99 -0
- package/src/operationsInterfaces/locations.ts +38 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/storageImportExport.ts +92 -0
- package/tsconfig.json +20 -7
- package/types/arm-storageimportexport.d.ts +671 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-storageimportexport.js +0 -1754
- package/dist/arm-storageimportexport.js.map +0 -1
- package/dist/arm-storageimportexport.min.js +0 -1
- package/dist/arm-storageimportexport.min.js.map +0 -1
- package/esm/models/bitLockerKeysMappers.d.ts +0 -2
- package/esm/models/bitLockerKeysMappers.d.ts.map +0 -1
- package/esm/models/bitLockerKeysMappers.js +0 -11
- package/esm/models/bitLockerKeysMappers.js.map +0 -1
- package/esm/models/index.d.ts +0 -928
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js +0 -10
- package/esm/models/index.js.map +0 -1
- package/esm/models/jobsMappers.d.ts +0 -2
- package/esm/models/jobsMappers.d.ts.map +0 -1
- package/esm/models/jobsMappers.js +0 -11
- package/esm/models/jobsMappers.js.map +0 -1
- package/esm/models/locationsMappers.d.ts +0 -2
- package/esm/models/locationsMappers.d.ts.map +0 -1
- package/esm/models/locationsMappers.js +0 -11
- package/esm/models/locationsMappers.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -23
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js.map +0 -1
- package/esm/models/operationsMappers.d.ts +0 -2
- package/esm/models/operationsMappers.d.ts.map +0 -1
- package/esm/models/operationsMappers.js +0 -11
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -12
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js.map +0 -1
- package/esm/operations/bitLockerKeys.d.ts +0 -37
- package/esm/operations/bitLockerKeys.d.ts.map +0 -1
- package/esm/operations/bitLockerKeys.js +0 -58
- package/esm/operations/bitLockerKeys.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/jobs.d.ts +0 -189
- package/esm/operations/jobs.d.ts.map +0 -1
- package/esm/operations/jobs.js +0 -276
- package/esm/operations/jobs.js.map +0 -1
- package/esm/operations/locations.d.ts +0 -48
- package/esm/operations/locations.d.ts.map +0 -1
- package/esm/operations/locations.js +0 -79
- package/esm/operations/locations.js.map +0 -1
- package/esm/operations/operations.d.ts +0 -28
- package/esm/operations/operations.d.ts.map +0 -1
- package/esm/operations/operations.js +0 -51
- package/esm/operations/operations.js.map +0 -1
- package/esm/storageImportExportManagementClient.d.ts +0 -21
- package/esm/storageImportExportManagementClient.d.ts.map +0 -1
- package/esm/storageImportExportManagementClient.js +0 -36
- package/esm/storageImportExportManagementClient.js.map +0 -1
- package/esm/storageImportExportManagementClientContext.d.ts +0 -16
- package/esm/storageImportExportManagementClientContext.d.ts.map +0 -1
- package/esm/storageImportExportManagementClientContext.js +0 -55
- package/esm/storageImportExportManagementClientContext.js.map +0 -1
- package/lib/models/bitLockerKeysMappers.ts +0 -17
- package/lib/models/index.ts +0 -975
- package/lib/models/jobsMappers.ts +0 -27
- package/lib/models/locationsMappers.ts +0 -17
- package/lib/models/operationsMappers.ts +0 -17
- package/lib/models/parameters.ts +0 -120
- package/lib/operations/bitLockerKeys.ts +0 -90
- package/lib/operations/jobs.ts +0 -500
- package/lib/operations/locations.ts +0 -127
- package/lib/operations/operations.ts +0 -74
- package/lib/storageImportExportManagementClient.ts +0 -48
- package/lib/storageImportExportManagementClientContext.ts +0 -61
|
@@ -0,0 +1,467 @@
|
|
|
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 { Jobs } 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 { StorageImportExport } from "../storageImportExport";
|
|
15
|
+
import {
|
|
16
|
+
JobResponse,
|
|
17
|
+
JobsListBySubscriptionNextOptionalParams,
|
|
18
|
+
JobsListBySubscriptionOptionalParams,
|
|
19
|
+
JobsListByResourceGroupNextOptionalParams,
|
|
20
|
+
JobsListByResourceGroupOptionalParams,
|
|
21
|
+
JobsListBySubscriptionResponse,
|
|
22
|
+
JobsListByResourceGroupResponse,
|
|
23
|
+
JobsGetOptionalParams,
|
|
24
|
+
JobsGetResponse,
|
|
25
|
+
UpdateJobParameters,
|
|
26
|
+
JobsUpdateOptionalParams,
|
|
27
|
+
JobsUpdateResponse,
|
|
28
|
+
PutJobParameters,
|
|
29
|
+
JobsCreateOptionalParams,
|
|
30
|
+
JobsCreateResponse,
|
|
31
|
+
JobsDeleteOptionalParams,
|
|
32
|
+
JobsListBySubscriptionNextResponse,
|
|
33
|
+
JobsListByResourceGroupNextResponse
|
|
34
|
+
} from "../models";
|
|
35
|
+
|
|
36
|
+
/// <reference lib="esnext.asynciterable" />
|
|
37
|
+
/** Class containing Jobs operations. */
|
|
38
|
+
export class JobsImpl implements Jobs {
|
|
39
|
+
private readonly client: StorageImportExport;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Initialize a new instance of the class Jobs class.
|
|
43
|
+
* @param client Reference to the service client
|
|
44
|
+
*/
|
|
45
|
+
constructor(client: StorageImportExport) {
|
|
46
|
+
this.client = client;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Returns all active and completed jobs in a subscription.
|
|
51
|
+
* @param options The options parameters.
|
|
52
|
+
*/
|
|
53
|
+
public listBySubscription(
|
|
54
|
+
options?: JobsListBySubscriptionOptionalParams
|
|
55
|
+
): PagedAsyncIterableIterator<JobResponse> {
|
|
56
|
+
const iter = this.listBySubscriptionPagingAll(options);
|
|
57
|
+
return {
|
|
58
|
+
next() {
|
|
59
|
+
return iter.next();
|
|
60
|
+
},
|
|
61
|
+
[Symbol.asyncIterator]() {
|
|
62
|
+
return this;
|
|
63
|
+
},
|
|
64
|
+
byPage: () => {
|
|
65
|
+
return this.listBySubscriptionPagingPage(options);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private async *listBySubscriptionPagingPage(
|
|
71
|
+
options?: JobsListBySubscriptionOptionalParams
|
|
72
|
+
): AsyncIterableIterator<JobResponse[]> {
|
|
73
|
+
let result = await this._listBySubscription(options);
|
|
74
|
+
yield result.value || [];
|
|
75
|
+
let continuationToken = result.nextLink;
|
|
76
|
+
while (continuationToken) {
|
|
77
|
+
result = await this._listBySubscriptionNext(continuationToken, options);
|
|
78
|
+
continuationToken = result.nextLink;
|
|
79
|
+
yield result.value || [];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private async *listBySubscriptionPagingAll(
|
|
84
|
+
options?: JobsListBySubscriptionOptionalParams
|
|
85
|
+
): AsyncIterableIterator<JobResponse> {
|
|
86
|
+
for await (const page of this.listBySubscriptionPagingPage(options)) {
|
|
87
|
+
yield* page;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Returns all active and completed jobs in a resource group.
|
|
93
|
+
* @param resourceGroupName The resource group name uniquely identifies the resource group within the
|
|
94
|
+
* user subscription.
|
|
95
|
+
* @param options The options parameters.
|
|
96
|
+
*/
|
|
97
|
+
public listByResourceGroup(
|
|
98
|
+
resourceGroupName: string,
|
|
99
|
+
options?: JobsListByResourceGroupOptionalParams
|
|
100
|
+
): PagedAsyncIterableIterator<JobResponse> {
|
|
101
|
+
const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
|
|
102
|
+
return {
|
|
103
|
+
next() {
|
|
104
|
+
return iter.next();
|
|
105
|
+
},
|
|
106
|
+
[Symbol.asyncIterator]() {
|
|
107
|
+
return this;
|
|
108
|
+
},
|
|
109
|
+
byPage: () => {
|
|
110
|
+
return this.listByResourceGroupPagingPage(resourceGroupName, options);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private async *listByResourceGroupPagingPage(
|
|
116
|
+
resourceGroupName: string,
|
|
117
|
+
options?: JobsListByResourceGroupOptionalParams
|
|
118
|
+
): AsyncIterableIterator<JobResponse[]> {
|
|
119
|
+
let result = await this._listByResourceGroup(resourceGroupName, options);
|
|
120
|
+
yield result.value || [];
|
|
121
|
+
let continuationToken = result.nextLink;
|
|
122
|
+
while (continuationToken) {
|
|
123
|
+
result = await this._listByResourceGroupNext(
|
|
124
|
+
resourceGroupName,
|
|
125
|
+
continuationToken,
|
|
126
|
+
options
|
|
127
|
+
);
|
|
128
|
+
continuationToken = result.nextLink;
|
|
129
|
+
yield result.value || [];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
private async *listByResourceGroupPagingAll(
|
|
134
|
+
resourceGroupName: string,
|
|
135
|
+
options?: JobsListByResourceGroupOptionalParams
|
|
136
|
+
): AsyncIterableIterator<JobResponse> {
|
|
137
|
+
for await (const page of this.listByResourceGroupPagingPage(
|
|
138
|
+
resourceGroupName,
|
|
139
|
+
options
|
|
140
|
+
)) {
|
|
141
|
+
yield* page;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Returns all active and completed jobs in a subscription.
|
|
147
|
+
* @param options The options parameters.
|
|
148
|
+
*/
|
|
149
|
+
private _listBySubscription(
|
|
150
|
+
options?: JobsListBySubscriptionOptionalParams
|
|
151
|
+
): Promise<JobsListBySubscriptionResponse> {
|
|
152
|
+
return this.client.sendOperationRequest(
|
|
153
|
+
{ options },
|
|
154
|
+
listBySubscriptionOperationSpec
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Returns all active and completed jobs in a resource group.
|
|
160
|
+
* @param resourceGroupName The resource group name uniquely identifies the resource group within the
|
|
161
|
+
* user subscription.
|
|
162
|
+
* @param options The options parameters.
|
|
163
|
+
*/
|
|
164
|
+
private _listByResourceGroup(
|
|
165
|
+
resourceGroupName: string,
|
|
166
|
+
options?: JobsListByResourceGroupOptionalParams
|
|
167
|
+
): Promise<JobsListByResourceGroupResponse> {
|
|
168
|
+
return this.client.sendOperationRequest(
|
|
169
|
+
{ resourceGroupName, options },
|
|
170
|
+
listByResourceGroupOperationSpec
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Gets information about an existing job.
|
|
176
|
+
* @param jobName The name of the import/export job.
|
|
177
|
+
* @param resourceGroupName The resource group name uniquely identifies the resource group within the
|
|
178
|
+
* user subscription.
|
|
179
|
+
* @param options The options parameters.
|
|
180
|
+
*/
|
|
181
|
+
get(
|
|
182
|
+
jobName: string,
|
|
183
|
+
resourceGroupName: string,
|
|
184
|
+
options?: JobsGetOptionalParams
|
|
185
|
+
): Promise<JobsGetResponse> {
|
|
186
|
+
return this.client.sendOperationRequest(
|
|
187
|
+
{ jobName, resourceGroupName, options },
|
|
188
|
+
getOperationSpec
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Updates specific properties of a job. You can call this operation to notify the Import/Export
|
|
194
|
+
* service that the hard drives comprising the import or export job have been shipped to the Microsoft
|
|
195
|
+
* data center. It can also be used to cancel an existing job.
|
|
196
|
+
* @param jobName The name of the import/export job.
|
|
197
|
+
* @param resourceGroupName The resource group name uniquely identifies the resource group within the
|
|
198
|
+
* user subscription.
|
|
199
|
+
* @param body The parameters to update in the job
|
|
200
|
+
* @param options The options parameters.
|
|
201
|
+
*/
|
|
202
|
+
update(
|
|
203
|
+
jobName: string,
|
|
204
|
+
resourceGroupName: string,
|
|
205
|
+
body: UpdateJobParameters,
|
|
206
|
+
options?: JobsUpdateOptionalParams
|
|
207
|
+
): Promise<JobsUpdateResponse> {
|
|
208
|
+
return this.client.sendOperationRequest(
|
|
209
|
+
{ jobName, resourceGroupName, body, options },
|
|
210
|
+
updateOperationSpec
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Creates a new job or updates an existing job in the specified subscription.
|
|
216
|
+
* @param jobName The name of the import/export job.
|
|
217
|
+
* @param resourceGroupName The resource group name uniquely identifies the resource group within the
|
|
218
|
+
* user subscription.
|
|
219
|
+
* @param body The parameters used for creating the job
|
|
220
|
+
* @param options The options parameters.
|
|
221
|
+
*/
|
|
222
|
+
create(
|
|
223
|
+
jobName: string,
|
|
224
|
+
resourceGroupName: string,
|
|
225
|
+
body: PutJobParameters,
|
|
226
|
+
options?: JobsCreateOptionalParams
|
|
227
|
+
): Promise<JobsCreateResponse> {
|
|
228
|
+
return this.client.sendOperationRequest(
|
|
229
|
+
{ jobName, resourceGroupName, body, options },
|
|
230
|
+
createOperationSpec
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Deletes an existing job. Only jobs in the Creating or Completed states can be deleted.
|
|
236
|
+
* @param jobName The name of the import/export job.
|
|
237
|
+
* @param resourceGroupName The resource group name uniquely identifies the resource group within the
|
|
238
|
+
* user subscription.
|
|
239
|
+
* @param options The options parameters.
|
|
240
|
+
*/
|
|
241
|
+
delete(
|
|
242
|
+
jobName: string,
|
|
243
|
+
resourceGroupName: string,
|
|
244
|
+
options?: JobsDeleteOptionalParams
|
|
245
|
+
): Promise<void> {
|
|
246
|
+
return this.client.sendOperationRequest(
|
|
247
|
+
{ jobName, resourceGroupName, options },
|
|
248
|
+
deleteOperationSpec
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* ListBySubscriptionNext
|
|
254
|
+
* @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
|
|
255
|
+
* @param options The options parameters.
|
|
256
|
+
*/
|
|
257
|
+
private _listBySubscriptionNext(
|
|
258
|
+
nextLink: string,
|
|
259
|
+
options?: JobsListBySubscriptionNextOptionalParams
|
|
260
|
+
): Promise<JobsListBySubscriptionNextResponse> {
|
|
261
|
+
return this.client.sendOperationRequest(
|
|
262
|
+
{ nextLink, options },
|
|
263
|
+
listBySubscriptionNextOperationSpec
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* ListByResourceGroupNext
|
|
269
|
+
* @param resourceGroupName The resource group name uniquely identifies the resource group within the
|
|
270
|
+
* user subscription.
|
|
271
|
+
* @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
|
|
272
|
+
* @param options The options parameters.
|
|
273
|
+
*/
|
|
274
|
+
private _listByResourceGroupNext(
|
|
275
|
+
resourceGroupName: string,
|
|
276
|
+
nextLink: string,
|
|
277
|
+
options?: JobsListByResourceGroupNextOptionalParams
|
|
278
|
+
): Promise<JobsListByResourceGroupNextResponse> {
|
|
279
|
+
return this.client.sendOperationRequest(
|
|
280
|
+
{ resourceGroupName, nextLink, options },
|
|
281
|
+
listByResourceGroupNextOperationSpec
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// Operation Specifications
|
|
286
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
287
|
+
|
|
288
|
+
const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
|
|
289
|
+
path: "/subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs",
|
|
290
|
+
httpMethod: "GET",
|
|
291
|
+
responses: {
|
|
292
|
+
200: {
|
|
293
|
+
bodyMapper: Mappers.ListJobsResponse
|
|
294
|
+
},
|
|
295
|
+
default: {
|
|
296
|
+
bodyMapper: Mappers.ErrorResponse
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter],
|
|
300
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
301
|
+
headerParameters: [Parameters.accept, Parameters.acceptLanguage],
|
|
302
|
+
serializer
|
|
303
|
+
};
|
|
304
|
+
const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
|
|
305
|
+
path:
|
|
306
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs",
|
|
307
|
+
httpMethod: "GET",
|
|
308
|
+
responses: {
|
|
309
|
+
200: {
|
|
310
|
+
bodyMapper: Mappers.ListJobsResponse
|
|
311
|
+
},
|
|
312
|
+
default: {
|
|
313
|
+
bodyMapper: Mappers.ErrorResponse
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter],
|
|
317
|
+
urlParameters: [
|
|
318
|
+
Parameters.$host,
|
|
319
|
+
Parameters.subscriptionId,
|
|
320
|
+
Parameters.resourceGroupName
|
|
321
|
+
],
|
|
322
|
+
headerParameters: [Parameters.accept, Parameters.acceptLanguage],
|
|
323
|
+
serializer
|
|
324
|
+
};
|
|
325
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
326
|
+
path:
|
|
327
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}",
|
|
328
|
+
httpMethod: "GET",
|
|
329
|
+
responses: {
|
|
330
|
+
200: {
|
|
331
|
+
bodyMapper: Mappers.JobResponse
|
|
332
|
+
},
|
|
333
|
+
default: {
|
|
334
|
+
bodyMapper: Mappers.ErrorResponse
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
queryParameters: [Parameters.apiVersion],
|
|
338
|
+
urlParameters: [
|
|
339
|
+
Parameters.$host,
|
|
340
|
+
Parameters.subscriptionId,
|
|
341
|
+
Parameters.resourceGroupName,
|
|
342
|
+
Parameters.jobName
|
|
343
|
+
],
|
|
344
|
+
headerParameters: [Parameters.accept, Parameters.acceptLanguage],
|
|
345
|
+
serializer
|
|
346
|
+
};
|
|
347
|
+
const updateOperationSpec: coreClient.OperationSpec = {
|
|
348
|
+
path:
|
|
349
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}",
|
|
350
|
+
httpMethod: "PATCH",
|
|
351
|
+
responses: {
|
|
352
|
+
200: {
|
|
353
|
+
bodyMapper: Mappers.JobResponse
|
|
354
|
+
},
|
|
355
|
+
default: {
|
|
356
|
+
bodyMapper: Mappers.ErrorResponse
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
requestBody: Parameters.body,
|
|
360
|
+
queryParameters: [Parameters.apiVersion],
|
|
361
|
+
urlParameters: [
|
|
362
|
+
Parameters.$host,
|
|
363
|
+
Parameters.subscriptionId,
|
|
364
|
+
Parameters.resourceGroupName,
|
|
365
|
+
Parameters.jobName
|
|
366
|
+
],
|
|
367
|
+
headerParameters: [
|
|
368
|
+
Parameters.accept,
|
|
369
|
+
Parameters.acceptLanguage,
|
|
370
|
+
Parameters.contentType
|
|
371
|
+
],
|
|
372
|
+
mediaType: "json",
|
|
373
|
+
serializer
|
|
374
|
+
};
|
|
375
|
+
const createOperationSpec: coreClient.OperationSpec = {
|
|
376
|
+
path:
|
|
377
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}",
|
|
378
|
+
httpMethod: "PUT",
|
|
379
|
+
responses: {
|
|
380
|
+
200: {
|
|
381
|
+
bodyMapper: Mappers.JobResponse
|
|
382
|
+
},
|
|
383
|
+
201: {
|
|
384
|
+
bodyMapper: Mappers.JobResponse
|
|
385
|
+
},
|
|
386
|
+
default: {
|
|
387
|
+
bodyMapper: Mappers.ErrorResponse
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
requestBody: Parameters.body1,
|
|
391
|
+
queryParameters: [Parameters.apiVersion],
|
|
392
|
+
urlParameters: [
|
|
393
|
+
Parameters.$host,
|
|
394
|
+
Parameters.subscriptionId,
|
|
395
|
+
Parameters.resourceGroupName,
|
|
396
|
+
Parameters.jobName
|
|
397
|
+
],
|
|
398
|
+
headerParameters: [
|
|
399
|
+
Parameters.accept,
|
|
400
|
+
Parameters.acceptLanguage,
|
|
401
|
+
Parameters.contentType,
|
|
402
|
+
Parameters.clientTenantId
|
|
403
|
+
],
|
|
404
|
+
mediaType: "json",
|
|
405
|
+
serializer
|
|
406
|
+
};
|
|
407
|
+
const deleteOperationSpec: coreClient.OperationSpec = {
|
|
408
|
+
path:
|
|
409
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}",
|
|
410
|
+
httpMethod: "DELETE",
|
|
411
|
+
responses: {
|
|
412
|
+
200: {},
|
|
413
|
+
default: {
|
|
414
|
+
bodyMapper: Mappers.ErrorResponse
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
queryParameters: [Parameters.apiVersion],
|
|
418
|
+
urlParameters: [
|
|
419
|
+
Parameters.$host,
|
|
420
|
+
Parameters.subscriptionId,
|
|
421
|
+
Parameters.resourceGroupName,
|
|
422
|
+
Parameters.jobName
|
|
423
|
+
],
|
|
424
|
+
headerParameters: [Parameters.accept, Parameters.acceptLanguage],
|
|
425
|
+
serializer
|
|
426
|
+
};
|
|
427
|
+
const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
|
|
428
|
+
path: "{nextLink}",
|
|
429
|
+
httpMethod: "GET",
|
|
430
|
+
responses: {
|
|
431
|
+
200: {
|
|
432
|
+
bodyMapper: Mappers.ListJobsResponse
|
|
433
|
+
},
|
|
434
|
+
default: {
|
|
435
|
+
bodyMapper: Mappers.ErrorResponse
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter],
|
|
439
|
+
urlParameters: [
|
|
440
|
+
Parameters.$host,
|
|
441
|
+
Parameters.subscriptionId,
|
|
442
|
+
Parameters.nextLink
|
|
443
|
+
],
|
|
444
|
+
headerParameters: [Parameters.accept, Parameters.acceptLanguage],
|
|
445
|
+
serializer
|
|
446
|
+
};
|
|
447
|
+
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
448
|
+
path: "{nextLink}",
|
|
449
|
+
httpMethod: "GET",
|
|
450
|
+
responses: {
|
|
451
|
+
200: {
|
|
452
|
+
bodyMapper: Mappers.ListJobsResponse
|
|
453
|
+
},
|
|
454
|
+
default: {
|
|
455
|
+
bodyMapper: Mappers.ErrorResponse
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter],
|
|
459
|
+
urlParameters: [
|
|
460
|
+
Parameters.$host,
|
|
461
|
+
Parameters.subscriptionId,
|
|
462
|
+
Parameters.resourceGroupName,
|
|
463
|
+
Parameters.nextLink
|
|
464
|
+
],
|
|
465
|
+
headerParameters: [Parameters.accept, Parameters.acceptLanguage],
|
|
466
|
+
serializer
|
|
467
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
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 { Locations } 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 { StorageImportExport } from "../storageImportExport";
|
|
15
|
+
import {
|
|
16
|
+
Location,
|
|
17
|
+
LocationsListOptionalParams,
|
|
18
|
+
LocationsListResponse,
|
|
19
|
+
LocationsGetOptionalParams,
|
|
20
|
+
LocationsGetResponse
|
|
21
|
+
} from "../models";
|
|
22
|
+
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing Locations operations. */
|
|
25
|
+
export class LocationsImpl implements Locations {
|
|
26
|
+
private readonly client: StorageImportExport;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initialize a new instance of the class Locations class.
|
|
30
|
+
* @param client Reference to the service client
|
|
31
|
+
*/
|
|
32
|
+
constructor(client: StorageImportExport) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns a list of locations to which you can ship the disks associated with an import or export job.
|
|
38
|
+
* A location is a Microsoft data center region.
|
|
39
|
+
* @param options The options parameters.
|
|
40
|
+
*/
|
|
41
|
+
public list(
|
|
42
|
+
options?: LocationsListOptionalParams
|
|
43
|
+
): PagedAsyncIterableIterator<Location> {
|
|
44
|
+
const iter = this.listPagingAll(options);
|
|
45
|
+
return {
|
|
46
|
+
next() {
|
|
47
|
+
return iter.next();
|
|
48
|
+
},
|
|
49
|
+
[Symbol.asyncIterator]() {
|
|
50
|
+
return this;
|
|
51
|
+
},
|
|
52
|
+
byPage: () => {
|
|
53
|
+
return this.listPagingPage(options);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private async *listPagingPage(
|
|
59
|
+
options?: LocationsListOptionalParams
|
|
60
|
+
): AsyncIterableIterator<Location[]> {
|
|
61
|
+
let result = await this._list(options);
|
|
62
|
+
yield result.value || [];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private async *listPagingAll(
|
|
66
|
+
options?: LocationsListOptionalParams
|
|
67
|
+
): AsyncIterableIterator<Location> {
|
|
68
|
+
for await (const page of this.listPagingPage(options)) {
|
|
69
|
+
yield* page;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns a list of locations to which you can ship the disks associated with an import or export job.
|
|
75
|
+
* A location is a Microsoft data center region.
|
|
76
|
+
* @param options The options parameters.
|
|
77
|
+
*/
|
|
78
|
+
private _list(
|
|
79
|
+
options?: LocationsListOptionalParams
|
|
80
|
+
): Promise<LocationsListResponse> {
|
|
81
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Returns the details about a location to which you can ship the disks associated with an import or
|
|
86
|
+
* export job. A location is an Azure region.
|
|
87
|
+
* @param locationName The name of the location. For example, West US or westus.
|
|
88
|
+
* @param options The options parameters.
|
|
89
|
+
*/
|
|
90
|
+
get(
|
|
91
|
+
locationName: string,
|
|
92
|
+
options?: LocationsGetOptionalParams
|
|
93
|
+
): Promise<LocationsGetResponse> {
|
|
94
|
+
return this.client.sendOperationRequest(
|
|
95
|
+
{ locationName, options },
|
|
96
|
+
getOperationSpec
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Operation Specifications
|
|
101
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
102
|
+
|
|
103
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
104
|
+
path: "/providers/Microsoft.ImportExport/locations",
|
|
105
|
+
httpMethod: "GET",
|
|
106
|
+
responses: {
|
|
107
|
+
200: {
|
|
108
|
+
bodyMapper: Mappers.LocationsResponse
|
|
109
|
+
},
|
|
110
|
+
default: {
|
|
111
|
+
bodyMapper: Mappers.ErrorResponse
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
queryParameters: [Parameters.apiVersion],
|
|
115
|
+
urlParameters: [Parameters.$host],
|
|
116
|
+
headerParameters: [Parameters.accept, Parameters.acceptLanguage],
|
|
117
|
+
serializer
|
|
118
|
+
};
|
|
119
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
120
|
+
path: "/providers/Microsoft.ImportExport/locations/{locationName}",
|
|
121
|
+
httpMethod: "GET",
|
|
122
|
+
responses: {
|
|
123
|
+
200: {
|
|
124
|
+
bodyMapper: Mappers.Location
|
|
125
|
+
},
|
|
126
|
+
default: {
|
|
127
|
+
bodyMapper: Mappers.ErrorResponse
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
queryParameters: [Parameters.apiVersion],
|
|
131
|
+
urlParameters: [Parameters.$host, Parameters.locationName],
|
|
132
|
+
headerParameters: [Parameters.accept, Parameters.acceptLanguage],
|
|
133
|
+
serializer
|
|
134
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
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 { Operations } 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 { StorageImportExport } from "../storageImportExport";
|
|
15
|
+
import {
|
|
16
|
+
Operation,
|
|
17
|
+
OperationsListOptionalParams,
|
|
18
|
+
OperationsListResponse
|
|
19
|
+
} from "../models";
|
|
20
|
+
|
|
21
|
+
/// <reference lib="esnext.asynciterable" />
|
|
22
|
+
/** Class containing Operations operations. */
|
|
23
|
+
export class OperationsImpl implements Operations {
|
|
24
|
+
private readonly client: StorageImportExport;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Initialize a new instance of the class Operations class.
|
|
28
|
+
* @param client Reference to the service client
|
|
29
|
+
*/
|
|
30
|
+
constructor(client: StorageImportExport) {
|
|
31
|
+
this.client = client;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Returns the list of operations supported by the import/export resource provider.
|
|
36
|
+
* @param options The options parameters.
|
|
37
|
+
*/
|
|
38
|
+
public list(
|
|
39
|
+
options?: OperationsListOptionalParams
|
|
40
|
+
): PagedAsyncIterableIterator<Operation> {
|
|
41
|
+
const iter = this.listPagingAll(options);
|
|
42
|
+
return {
|
|
43
|
+
next() {
|
|
44
|
+
return iter.next();
|
|
45
|
+
},
|
|
46
|
+
[Symbol.asyncIterator]() {
|
|
47
|
+
return this;
|
|
48
|
+
},
|
|
49
|
+
byPage: () => {
|
|
50
|
+
return this.listPagingPage(options);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private async *listPagingPage(
|
|
56
|
+
options?: OperationsListOptionalParams
|
|
57
|
+
): AsyncIterableIterator<Operation[]> {
|
|
58
|
+
let result = await this._list(options);
|
|
59
|
+
yield result.value || [];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private async *listPagingAll(
|
|
63
|
+
options?: OperationsListOptionalParams
|
|
64
|
+
): AsyncIterableIterator<Operation> {
|
|
65
|
+
for await (const page of this.listPagingPage(options)) {
|
|
66
|
+
yield* page;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Returns the list of operations supported by the import/export resource provider.
|
|
72
|
+
* @param options The options parameters.
|
|
73
|
+
*/
|
|
74
|
+
private _list(
|
|
75
|
+
options?: OperationsListOptionalParams
|
|
76
|
+
): Promise<OperationsListResponse> {
|
|
77
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Operation Specifications
|
|
81
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
82
|
+
|
|
83
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
84
|
+
path: "/providers/Microsoft.ImportExport/operations",
|
|
85
|
+
httpMethod: "GET",
|
|
86
|
+
responses: {
|
|
87
|
+
200: {
|
|
88
|
+
bodyMapper: Mappers.ListOperationsResponse
|
|
89
|
+
},
|
|
90
|
+
default: {
|
|
91
|
+
bodyMapper: Mappers.ErrorResponse
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
queryParameters: [Parameters.apiVersion],
|
|
95
|
+
urlParameters: [Parameters.$host],
|
|
96
|
+
headerParameters: [Parameters.accept, Parameters.acceptLanguage],
|
|
97
|
+
serializer
|
|
98
|
+
};
|