@azure/arm-baremetalinfrastructure 1.0.0-beta.1 → 1.0.0-beta.2
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 +71 -0
- package/README.md +2 -2
- package/dist/index.js +1234 -194
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/azureBareMetalInstancesGetSample.js +3 -3
- package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.js +6 -11
- package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.js +6 -11
- package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/azureBareMetalInstancesRestartSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesRestartSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesRestartSample.js +39 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesRestartSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesShutdownSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesShutdownSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesShutdownSample.js +39 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesShutdownSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesStartSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesStartSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesStartSample.js +39 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesStartSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesUpdateSample.js +6 -6
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesCreateSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesCreateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesCreateSample.js +56 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesCreateSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesDeleteSample.js +39 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesGetSample.js +39 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesListByResourceGroupSample.js +54 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesListBySubscriptionSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesListBySubscriptionSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesListBySubscriptionSample.js +53 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesListBySubscriptionSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesUpdateSample.js +60 -0
- package/dist-esm/samples-dev/azureBareMetalStorageInstancesUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.js +4 -9
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/src/bareMetalInfrastructureClient.d.ts +3 -2
- package/dist-esm/src/bareMetalInfrastructureClient.d.ts.map +1 -1
- package/dist-esm/src/bareMetalInfrastructureClient.js +5 -4
- package/dist-esm/src/bareMetalInfrastructureClient.js.map +1 -1
- package/dist-esm/src/lroImpl.d.ts +11 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +21 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +370 -81
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +60 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts +17 -7
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +372 -96
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/models/parameters.d.ts +3 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -1
- package/dist-esm/src/models/parameters.js +27 -6
- package/dist-esm/src/models/parameters.js.map +1 -1
- package/dist-esm/src/operations/azureBareMetalInstances.d.ts +65 -14
- package/dist-esm/src/operations/azureBareMetalInstances.d.ts.map +1 -1
- package/dist-esm/src/operations/azureBareMetalInstances.js +290 -30
- package/dist-esm/src/operations/azureBareMetalInstances.js.map +1 -1
- package/dist-esm/src/operations/azureBareMetalStorageInstances.d.ts +93 -0
- package/dist-esm/src/operations/azureBareMetalStorageInstances.d.ts.map +1 -0
- package/dist-esm/src/operations/azureBareMetalStorageInstances.js +404 -0
- package/dist-esm/src/operations/azureBareMetalStorageInstances.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +1 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -1
- package/dist-esm/src/operations/index.js +1 -0
- package/dist-esm/src/operations/index.js.map +1 -1
- package/dist-esm/src/operations/operations.js +4 -9
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.d.ts +61 -10
- package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/azureBareMetalStorageInstances.d.ts +55 -0
- package/dist-esm/src/operationsInterfaces/azureBareMetalStorageInstances.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/azureBareMetalStorageInstances.js +9 -0
- package/dist-esm/src/operationsInterfaces/azureBareMetalStorageInstances.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/index.js +1 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
- package/dist-esm/test/baremetalinfrastructure_operations_test.spec.js +7 -9
- package/dist-esm/test/baremetalinfrastructure_operations_test.spec.js.map +1 -1
- package/package.json +17 -19
- package/review/arm-baremetalinfrastructure.api.md +244 -19
- package/src/bareMetalInfrastructureClient.ts +17 -5
- package/src/lroImpl.ts +42 -0
- package/src/models/index.ts +417 -84
- package/src/models/mappers.ts +388 -98
- package/src/models/parameters.ts +34 -6
- package/src/operations/azureBareMetalInstances.ts +401 -13
- package/src/operations/azureBareMetalStorageInstances.ts +498 -0
- package/src/operations/index.ts +1 -0
- package/src/operations/operations.ts +1 -1
- package/src/operationsInterfaces/azureBareMetalInstances.ts +105 -9
- package/src/operationsInterfaces/azureBareMetalStorageInstances.ts +99 -0
- package/src/operationsInterfaces/index.ts +1 -0
- package/types/arm-baremetalinfrastructure.d.ts +516 -80
- package/types/tsdoc-metadata.json +1 -1
- package/rollup.config.js +0 -122
|
@@ -13,6 +13,12 @@ import * as coreClient from "@azure/core-client";
|
|
|
13
13
|
import * as Mappers from "../models/mappers";
|
|
14
14
|
import * as Parameters from "../models/parameters";
|
|
15
15
|
import { BareMetalInfrastructureClient } from "../bareMetalInfrastructureClient";
|
|
16
|
+
import {
|
|
17
|
+
SimplePollerLike,
|
|
18
|
+
OperationState,
|
|
19
|
+
createHttpPoller
|
|
20
|
+
} from "@azure/core-lro";
|
|
21
|
+
import { createLroSpec } from "../lroImpl";
|
|
16
22
|
import {
|
|
17
23
|
AzureBareMetalInstance,
|
|
18
24
|
AzureBareMetalInstancesListBySubscriptionNextOptionalParams,
|
|
@@ -21,6 +27,12 @@ import {
|
|
|
21
27
|
AzureBareMetalInstancesListByResourceGroupNextOptionalParams,
|
|
22
28
|
AzureBareMetalInstancesListByResourceGroupOptionalParams,
|
|
23
29
|
AzureBareMetalInstancesListByResourceGroupResponse,
|
|
30
|
+
AzureBareMetalInstancesStartOptionalParams,
|
|
31
|
+
AzureBareMetalInstancesStartResponse,
|
|
32
|
+
AzureBareMetalInstancesRestartOptionalParams,
|
|
33
|
+
AzureBareMetalInstancesRestartResponse,
|
|
34
|
+
AzureBareMetalInstancesShutdownOptionalParams,
|
|
35
|
+
AzureBareMetalInstancesShutdownResponse,
|
|
24
36
|
AzureBareMetalInstancesGetOptionalParams,
|
|
25
37
|
AzureBareMetalInstancesGetResponse,
|
|
26
38
|
Tags,
|
|
@@ -44,8 +56,8 @@ export class AzureBareMetalInstancesImpl implements AzureBareMetalInstances {
|
|
|
44
56
|
}
|
|
45
57
|
|
|
46
58
|
/**
|
|
47
|
-
*
|
|
48
|
-
* various properties of each Azure
|
|
59
|
+
* Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns
|
|
60
|
+
* various properties of each Azure Bare Metal Instance.
|
|
49
61
|
* @param options The options parameters.
|
|
50
62
|
*/
|
|
51
63
|
public listBySubscription(
|
|
@@ -99,8 +111,8 @@ export class AzureBareMetalInstancesImpl implements AzureBareMetalInstances {
|
|
|
99
111
|
}
|
|
100
112
|
|
|
101
113
|
/**
|
|
102
|
-
* Gets a list of
|
|
103
|
-
* operations returns various properties of each Azure
|
|
114
|
+
* Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The
|
|
115
|
+
* operations returns various properties of each Azure Bare Metal Instance.
|
|
104
116
|
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
105
117
|
* @param options The options parameters.
|
|
106
118
|
*/
|
|
@@ -169,8 +181,287 @@ export class AzureBareMetalInstancesImpl implements AzureBareMetalInstances {
|
|
|
169
181
|
}
|
|
170
182
|
|
|
171
183
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
184
|
+
* The operation to start an Azure Bare Metal instance
|
|
185
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
186
|
+
* @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the
|
|
187
|
+
* ResourceName.
|
|
188
|
+
* @param options The options parameters.
|
|
189
|
+
*/
|
|
190
|
+
async beginStart(
|
|
191
|
+
resourceGroupName: string,
|
|
192
|
+
azureBareMetalInstanceName: string,
|
|
193
|
+
options?: AzureBareMetalInstancesStartOptionalParams
|
|
194
|
+
): Promise<
|
|
195
|
+
SimplePollerLike<
|
|
196
|
+
OperationState<AzureBareMetalInstancesStartResponse>,
|
|
197
|
+
AzureBareMetalInstancesStartResponse
|
|
198
|
+
>
|
|
199
|
+
> {
|
|
200
|
+
const directSendOperation = async (
|
|
201
|
+
args: coreClient.OperationArguments,
|
|
202
|
+
spec: coreClient.OperationSpec
|
|
203
|
+
): Promise<AzureBareMetalInstancesStartResponse> => {
|
|
204
|
+
return this.client.sendOperationRequest(args, spec);
|
|
205
|
+
};
|
|
206
|
+
const sendOperationFn = async (
|
|
207
|
+
args: coreClient.OperationArguments,
|
|
208
|
+
spec: coreClient.OperationSpec
|
|
209
|
+
) => {
|
|
210
|
+
let currentRawResponse:
|
|
211
|
+
| coreClient.FullOperationResponse
|
|
212
|
+
| undefined = undefined;
|
|
213
|
+
const providedCallback = args.options?.onResponse;
|
|
214
|
+
const callback: coreClient.RawResponseCallback = (
|
|
215
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
216
|
+
flatResponse: unknown
|
|
217
|
+
) => {
|
|
218
|
+
currentRawResponse = rawResponse;
|
|
219
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
220
|
+
};
|
|
221
|
+
const updatedArgs = {
|
|
222
|
+
...args,
|
|
223
|
+
options: {
|
|
224
|
+
...args.options,
|
|
225
|
+
onResponse: callback
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
229
|
+
return {
|
|
230
|
+
flatResponse,
|
|
231
|
+
rawResponse: {
|
|
232
|
+
statusCode: currentRawResponse!.status,
|
|
233
|
+
body: currentRawResponse!.parsedBody,
|
|
234
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const lro = createLroSpec({
|
|
240
|
+
sendOperationFn,
|
|
241
|
+
args: { resourceGroupName, azureBareMetalInstanceName, options },
|
|
242
|
+
spec: startOperationSpec
|
|
243
|
+
});
|
|
244
|
+
const poller = await createHttpPoller<
|
|
245
|
+
AzureBareMetalInstancesStartResponse,
|
|
246
|
+
OperationState<AzureBareMetalInstancesStartResponse>
|
|
247
|
+
>(lro, {
|
|
248
|
+
restoreFrom: options?.resumeFrom,
|
|
249
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
250
|
+
resourceLocationConfig: "location"
|
|
251
|
+
});
|
|
252
|
+
await poller.poll();
|
|
253
|
+
return poller;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The operation to start an Azure Bare Metal instance
|
|
258
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
259
|
+
* @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the
|
|
260
|
+
* ResourceName.
|
|
261
|
+
* @param options The options parameters.
|
|
262
|
+
*/
|
|
263
|
+
async beginStartAndWait(
|
|
264
|
+
resourceGroupName: string,
|
|
265
|
+
azureBareMetalInstanceName: string,
|
|
266
|
+
options?: AzureBareMetalInstancesStartOptionalParams
|
|
267
|
+
): Promise<AzureBareMetalInstancesStartResponse> {
|
|
268
|
+
const poller = await this.beginStart(
|
|
269
|
+
resourceGroupName,
|
|
270
|
+
azureBareMetalInstanceName,
|
|
271
|
+
options
|
|
272
|
+
);
|
|
273
|
+
return poller.pollUntilDone();
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* The operation to restart an Azure Bare Metal Instance
|
|
278
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
279
|
+
* @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the
|
|
280
|
+
* ResourceName.
|
|
281
|
+
* @param options The options parameters.
|
|
282
|
+
*/
|
|
283
|
+
async beginRestart(
|
|
284
|
+
resourceGroupName: string,
|
|
285
|
+
azureBareMetalInstanceName: string,
|
|
286
|
+
options?: AzureBareMetalInstancesRestartOptionalParams
|
|
287
|
+
): Promise<
|
|
288
|
+
SimplePollerLike<
|
|
289
|
+
OperationState<AzureBareMetalInstancesRestartResponse>,
|
|
290
|
+
AzureBareMetalInstancesRestartResponse
|
|
291
|
+
>
|
|
292
|
+
> {
|
|
293
|
+
const directSendOperation = async (
|
|
294
|
+
args: coreClient.OperationArguments,
|
|
295
|
+
spec: coreClient.OperationSpec
|
|
296
|
+
): Promise<AzureBareMetalInstancesRestartResponse> => {
|
|
297
|
+
return this.client.sendOperationRequest(args, spec);
|
|
298
|
+
};
|
|
299
|
+
const sendOperationFn = async (
|
|
300
|
+
args: coreClient.OperationArguments,
|
|
301
|
+
spec: coreClient.OperationSpec
|
|
302
|
+
) => {
|
|
303
|
+
let currentRawResponse:
|
|
304
|
+
| coreClient.FullOperationResponse
|
|
305
|
+
| undefined = undefined;
|
|
306
|
+
const providedCallback = args.options?.onResponse;
|
|
307
|
+
const callback: coreClient.RawResponseCallback = (
|
|
308
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
309
|
+
flatResponse: unknown
|
|
310
|
+
) => {
|
|
311
|
+
currentRawResponse = rawResponse;
|
|
312
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
313
|
+
};
|
|
314
|
+
const updatedArgs = {
|
|
315
|
+
...args,
|
|
316
|
+
options: {
|
|
317
|
+
...args.options,
|
|
318
|
+
onResponse: callback
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
322
|
+
return {
|
|
323
|
+
flatResponse,
|
|
324
|
+
rawResponse: {
|
|
325
|
+
statusCode: currentRawResponse!.status,
|
|
326
|
+
body: currentRawResponse!.parsedBody,
|
|
327
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
const lro = createLroSpec({
|
|
333
|
+
sendOperationFn,
|
|
334
|
+
args: { resourceGroupName, azureBareMetalInstanceName, options },
|
|
335
|
+
spec: restartOperationSpec
|
|
336
|
+
});
|
|
337
|
+
const poller = await createHttpPoller<
|
|
338
|
+
AzureBareMetalInstancesRestartResponse,
|
|
339
|
+
OperationState<AzureBareMetalInstancesRestartResponse>
|
|
340
|
+
>(lro, {
|
|
341
|
+
restoreFrom: options?.resumeFrom,
|
|
342
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
343
|
+
resourceLocationConfig: "location"
|
|
344
|
+
});
|
|
345
|
+
await poller.poll();
|
|
346
|
+
return poller;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* The operation to restart an Azure Bare Metal Instance
|
|
351
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
352
|
+
* @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the
|
|
353
|
+
* ResourceName.
|
|
354
|
+
* @param options The options parameters.
|
|
355
|
+
*/
|
|
356
|
+
async beginRestartAndWait(
|
|
357
|
+
resourceGroupName: string,
|
|
358
|
+
azureBareMetalInstanceName: string,
|
|
359
|
+
options?: AzureBareMetalInstancesRestartOptionalParams
|
|
360
|
+
): Promise<AzureBareMetalInstancesRestartResponse> {
|
|
361
|
+
const poller = await this.beginRestart(
|
|
362
|
+
resourceGroupName,
|
|
363
|
+
azureBareMetalInstanceName,
|
|
364
|
+
options
|
|
365
|
+
);
|
|
366
|
+
return poller.pollUntilDone();
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* The operation to shutdown an Azure Bare Metal Instance
|
|
371
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
372
|
+
* @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the
|
|
373
|
+
* ResourceName.
|
|
374
|
+
* @param options The options parameters.
|
|
375
|
+
*/
|
|
376
|
+
async beginShutdown(
|
|
377
|
+
resourceGroupName: string,
|
|
378
|
+
azureBareMetalInstanceName: string,
|
|
379
|
+
options?: AzureBareMetalInstancesShutdownOptionalParams
|
|
380
|
+
): Promise<
|
|
381
|
+
SimplePollerLike<
|
|
382
|
+
OperationState<AzureBareMetalInstancesShutdownResponse>,
|
|
383
|
+
AzureBareMetalInstancesShutdownResponse
|
|
384
|
+
>
|
|
385
|
+
> {
|
|
386
|
+
const directSendOperation = async (
|
|
387
|
+
args: coreClient.OperationArguments,
|
|
388
|
+
spec: coreClient.OperationSpec
|
|
389
|
+
): Promise<AzureBareMetalInstancesShutdownResponse> => {
|
|
390
|
+
return this.client.sendOperationRequest(args, spec);
|
|
391
|
+
};
|
|
392
|
+
const sendOperationFn = async (
|
|
393
|
+
args: coreClient.OperationArguments,
|
|
394
|
+
spec: coreClient.OperationSpec
|
|
395
|
+
) => {
|
|
396
|
+
let currentRawResponse:
|
|
397
|
+
| coreClient.FullOperationResponse
|
|
398
|
+
| undefined = undefined;
|
|
399
|
+
const providedCallback = args.options?.onResponse;
|
|
400
|
+
const callback: coreClient.RawResponseCallback = (
|
|
401
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
402
|
+
flatResponse: unknown
|
|
403
|
+
) => {
|
|
404
|
+
currentRawResponse = rawResponse;
|
|
405
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
406
|
+
};
|
|
407
|
+
const updatedArgs = {
|
|
408
|
+
...args,
|
|
409
|
+
options: {
|
|
410
|
+
...args.options,
|
|
411
|
+
onResponse: callback
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
415
|
+
return {
|
|
416
|
+
flatResponse,
|
|
417
|
+
rawResponse: {
|
|
418
|
+
statusCode: currentRawResponse!.status,
|
|
419
|
+
body: currentRawResponse!.parsedBody,
|
|
420
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const lro = createLroSpec({
|
|
426
|
+
sendOperationFn,
|
|
427
|
+
args: { resourceGroupName, azureBareMetalInstanceName, options },
|
|
428
|
+
spec: shutdownOperationSpec
|
|
429
|
+
});
|
|
430
|
+
const poller = await createHttpPoller<
|
|
431
|
+
AzureBareMetalInstancesShutdownResponse,
|
|
432
|
+
OperationState<AzureBareMetalInstancesShutdownResponse>
|
|
433
|
+
>(lro, {
|
|
434
|
+
restoreFrom: options?.resumeFrom,
|
|
435
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
436
|
+
resourceLocationConfig: "location"
|
|
437
|
+
});
|
|
438
|
+
await poller.poll();
|
|
439
|
+
return poller;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* The operation to shutdown an Azure Bare Metal Instance
|
|
444
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
445
|
+
* @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the
|
|
446
|
+
* ResourceName.
|
|
447
|
+
* @param options The options parameters.
|
|
448
|
+
*/
|
|
449
|
+
async beginShutdownAndWait(
|
|
450
|
+
resourceGroupName: string,
|
|
451
|
+
azureBareMetalInstanceName: string,
|
|
452
|
+
options?: AzureBareMetalInstancesShutdownOptionalParams
|
|
453
|
+
): Promise<AzureBareMetalInstancesShutdownResponse> {
|
|
454
|
+
const poller = await this.beginShutdown(
|
|
455
|
+
resourceGroupName,
|
|
456
|
+
azureBareMetalInstanceName,
|
|
457
|
+
options
|
|
458
|
+
);
|
|
459
|
+
return poller.pollUntilDone();
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns
|
|
464
|
+
* various properties of each Azure Bare Metal Instance.
|
|
174
465
|
* @param options The options parameters.
|
|
175
466
|
*/
|
|
176
467
|
private _listBySubscription(
|
|
@@ -183,8 +474,8 @@ export class AzureBareMetalInstancesImpl implements AzureBareMetalInstances {
|
|
|
183
474
|
}
|
|
184
475
|
|
|
185
476
|
/**
|
|
186
|
-
* Gets a list of
|
|
187
|
-
* operations returns various properties of each Azure
|
|
477
|
+
* Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The
|
|
478
|
+
* operations returns various properties of each Azure Bare Metal Instance.
|
|
188
479
|
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
189
480
|
* @param options The options parameters.
|
|
190
481
|
*/
|
|
@@ -199,9 +490,10 @@ export class AzureBareMetalInstancesImpl implements AzureBareMetalInstances {
|
|
|
199
490
|
}
|
|
200
491
|
|
|
201
492
|
/**
|
|
202
|
-
* Gets an Azure
|
|
493
|
+
* Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name.
|
|
203
494
|
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
204
|
-
* @param azureBareMetalInstanceName Name of the Azure
|
|
495
|
+
* @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the
|
|
496
|
+
* ResourceName.
|
|
205
497
|
* @param options The options parameters.
|
|
206
498
|
*/
|
|
207
499
|
get(
|
|
@@ -216,10 +508,11 @@ export class AzureBareMetalInstancesImpl implements AzureBareMetalInstances {
|
|
|
216
508
|
}
|
|
217
509
|
|
|
218
510
|
/**
|
|
219
|
-
* Patches the Tags field of a Azure
|
|
220
|
-
* and instance name.
|
|
511
|
+
* Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource
|
|
512
|
+
* group, and instance name.
|
|
221
513
|
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
222
|
-
* @param azureBareMetalInstanceName Name of the Azure
|
|
514
|
+
* @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the
|
|
515
|
+
* ResourceName.
|
|
223
516
|
* @param tagsParameter Request body that only contains the new Tags field
|
|
224
517
|
* @param options The options parameters.
|
|
225
518
|
*/
|
|
@@ -270,6 +563,101 @@ export class AzureBareMetalInstancesImpl implements AzureBareMetalInstances {
|
|
|
270
563
|
// Operation Specifications
|
|
271
564
|
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
272
565
|
|
|
566
|
+
const startOperationSpec: coreClient.OperationSpec = {
|
|
567
|
+
path:
|
|
568
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}/start",
|
|
569
|
+
httpMethod: "POST",
|
|
570
|
+
responses: {
|
|
571
|
+
200: {
|
|
572
|
+
bodyMapper: Mappers.OperationStatus
|
|
573
|
+
},
|
|
574
|
+
201: {
|
|
575
|
+
bodyMapper: Mappers.OperationStatus
|
|
576
|
+
},
|
|
577
|
+
202: {
|
|
578
|
+
bodyMapper: Mappers.OperationStatus
|
|
579
|
+
},
|
|
580
|
+
204: {
|
|
581
|
+
bodyMapper: Mappers.OperationStatus
|
|
582
|
+
},
|
|
583
|
+
default: {
|
|
584
|
+
bodyMapper: Mappers.ErrorResponse
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
queryParameters: [Parameters.apiVersion],
|
|
588
|
+
urlParameters: [
|
|
589
|
+
Parameters.$host,
|
|
590
|
+
Parameters.subscriptionId,
|
|
591
|
+
Parameters.resourceGroupName,
|
|
592
|
+
Parameters.azureBareMetalInstanceName
|
|
593
|
+
],
|
|
594
|
+
headerParameters: [Parameters.accept],
|
|
595
|
+
serializer
|
|
596
|
+
};
|
|
597
|
+
const restartOperationSpec: coreClient.OperationSpec = {
|
|
598
|
+
path:
|
|
599
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}/restart",
|
|
600
|
+
httpMethod: "POST",
|
|
601
|
+
responses: {
|
|
602
|
+
200: {
|
|
603
|
+
bodyMapper: Mappers.OperationStatus
|
|
604
|
+
},
|
|
605
|
+
201: {
|
|
606
|
+
bodyMapper: Mappers.OperationStatus
|
|
607
|
+
},
|
|
608
|
+
202: {
|
|
609
|
+
bodyMapper: Mappers.OperationStatus
|
|
610
|
+
},
|
|
611
|
+
204: {
|
|
612
|
+
bodyMapper: Mappers.OperationStatus
|
|
613
|
+
},
|
|
614
|
+
default: {
|
|
615
|
+
bodyMapper: Mappers.ErrorResponse
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
requestBody: Parameters.forceParameter,
|
|
619
|
+
queryParameters: [Parameters.apiVersion],
|
|
620
|
+
urlParameters: [
|
|
621
|
+
Parameters.$host,
|
|
622
|
+
Parameters.subscriptionId,
|
|
623
|
+
Parameters.resourceGroupName,
|
|
624
|
+
Parameters.azureBareMetalInstanceName
|
|
625
|
+
],
|
|
626
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
627
|
+
mediaType: "json",
|
|
628
|
+
serializer
|
|
629
|
+
};
|
|
630
|
+
const shutdownOperationSpec: coreClient.OperationSpec = {
|
|
631
|
+
path:
|
|
632
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}/shutdown",
|
|
633
|
+
httpMethod: "POST",
|
|
634
|
+
responses: {
|
|
635
|
+
200: {
|
|
636
|
+
bodyMapper: Mappers.OperationStatus
|
|
637
|
+
},
|
|
638
|
+
201: {
|
|
639
|
+
bodyMapper: Mappers.OperationStatus
|
|
640
|
+
},
|
|
641
|
+
202: {
|
|
642
|
+
bodyMapper: Mappers.OperationStatus
|
|
643
|
+
},
|
|
644
|
+
204: {
|
|
645
|
+
bodyMapper: Mappers.OperationStatus
|
|
646
|
+
},
|
|
647
|
+
default: {
|
|
648
|
+
bodyMapper: Mappers.ErrorResponse
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
queryParameters: [Parameters.apiVersion],
|
|
652
|
+
urlParameters: [
|
|
653
|
+
Parameters.$host,
|
|
654
|
+
Parameters.subscriptionId,
|
|
655
|
+
Parameters.resourceGroupName,
|
|
656
|
+
Parameters.azureBareMetalInstanceName
|
|
657
|
+
],
|
|
658
|
+
headerParameters: [Parameters.accept],
|
|
659
|
+
serializer
|
|
660
|
+
};
|
|
273
661
|
const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
|
|
274
662
|
path:
|
|
275
663
|
"/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances",
|