@azure/arm-serialconsole 1.1.1 → 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.
Files changed (121) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +69 -80
  4. package/dist/index.js +861 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/index.d.ts +4 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +11 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/microsoftSerialConsoleClient.d.ts +42 -0
  13. package/dist-esm/src/microsoftSerialConsoleClient.d.ts.map +1 -0
  14. package/dist-esm/src/microsoftSerialConsoleClient.js +160 -0
  15. package/dist-esm/src/microsoftSerialConsoleClient.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +150 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +9 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +16 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/dist-esm/src/models/mappers.js +285 -0
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +14 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +128 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/index.d.ts +2 -0
  29. package/dist-esm/src/operations/index.d.ts.map +1 -0
  30. package/dist-esm/src/operations/index.js +9 -0
  31. package/dist-esm/src/operations/index.js.map +1 -0
  32. package/dist-esm/src/operations/serialPorts.d.ts +78 -0
  33. package/dist-esm/src/operations/serialPorts.d.ts.map +1 -0
  34. package/dist-esm/src/operations/serialPorts.js +270 -0
  35. package/dist-esm/src/operations/serialPorts.js.map +1 -0
  36. package/dist-esm/src/operationsInterfaces/index.d.ts +2 -0
  37. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  38. package/dist-esm/src/operationsInterfaces/index.js +9 -0
  39. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  40. package/dist-esm/src/operationsInterfaces/serialPorts.d.ts +70 -0
  41. package/dist-esm/src/operationsInterfaces/serialPorts.d.ts.map +1 -0
  42. package/dist-esm/src/operationsInterfaces/serialPorts.js +9 -0
  43. package/dist-esm/src/operationsInterfaces/serialPorts.js.map +1 -0
  44. package/dist-esm/test/sampleTest.d.ts +2 -0
  45. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  46. package/dist-esm/test/sampleTest.js +40 -0
  47. package/dist-esm/test/sampleTest.js.map +1 -0
  48. package/package.json +71 -33
  49. package/review/arm-serialconsole.api.md +202 -0
  50. package/rollup.config.js +181 -30
  51. package/src/index.ts +11 -0
  52. package/src/microsoftSerialConsoleClient.ts +206 -36
  53. package/src/models/index.ts +163 -126
  54. package/src/models/mappers.ts +238 -26
  55. package/src/models/parameters.ts +110 -19
  56. package/src/operations/index.ts +4 -8
  57. package/src/operations/serialPorts.ts +357 -0
  58. package/src/operationsInterfaces/index.ts +9 -0
  59. package/src/operationsInterfaces/serialPorts.ts +128 -0
  60. package/tsconfig.json +4 -4
  61. package/types/arm-serialconsole.d.ts +294 -0
  62. package/types/tsdoc-metadata.json +11 -0
  63. package/dist/arm-serialconsole.js +0 -532
  64. package/dist/arm-serialconsole.js.map +0 -1
  65. package/dist/arm-serialconsole.min.js +0 -1
  66. package/dist/arm-serialconsole.min.js.map +0 -1
  67. package/esm/microsoftSerialConsoleClient.d.ts +0 -26
  68. package/esm/microsoftSerialConsoleClient.d.ts.map +0 -1
  69. package/esm/microsoftSerialConsoleClient.js +0 -40
  70. package/esm/microsoftSerialConsoleClient.js.map +0 -1
  71. package/esm/microsoftSerialConsoleClientContext.d.ts +0 -22
  72. package/esm/microsoftSerialConsoleClientContext.d.ts.map +0 -1
  73. package/esm/microsoftSerialConsoleClientContext.js +0 -61
  74. package/esm/microsoftSerialConsoleClientContext.js.map +0 -1
  75. package/esm/models/consoleMappers.d.ts +0 -2
  76. package/esm/models/consoleMappers.d.ts.map +0 -1
  77. package/esm/models/consoleMappers.js +0 -9
  78. package/esm/models/consoleMappers.js.map +0 -1
  79. package/esm/models/index.d.ts +0 -133
  80. package/esm/models/index.d.ts.map +0 -1
  81. package/esm/models/index.js +0 -8
  82. package/esm/models/index.js.map +0 -1
  83. package/esm/models/listConsoleMappers.d.ts +0 -2
  84. package/esm/models/listConsoleMappers.d.ts.map +0 -1
  85. package/esm/models/listConsoleMappers.js +0 -9
  86. package/esm/models/listConsoleMappers.js.map +0 -1
  87. package/esm/models/listMappers.d.ts +0 -2
  88. package/esm/models/listMappers.d.ts.map +0 -1
  89. package/esm/models/listMappers.js +0 -9
  90. package/esm/models/listMappers.js.map +0 -1
  91. package/esm/models/mappers.d.ts +0 -9
  92. package/esm/models/mappers.d.ts.map +0 -1
  93. package/esm/models/mappers.js +0 -86
  94. package/esm/models/mappers.js.map +0 -1
  95. package/esm/models/parameters.d.ts +0 -6
  96. package/esm/models/parameters.d.ts.map +0 -1
  97. package/esm/models/parameters.js +0 -52
  98. package/esm/models/parameters.js.map +0 -1
  99. package/esm/operations/console.d.ts +0 -43
  100. package/esm/operations/console.d.ts.map +0 -1
  101. package/esm/operations/console.js +0 -83
  102. package/esm/operations/console.js.map +0 -1
  103. package/esm/operations/index.d.ts +0 -4
  104. package/esm/operations/index.d.ts.map +0 -1
  105. package/esm/operations/index.js +0 -13
  106. package/esm/operations/index.js.map +0 -1
  107. package/esm/operations/list.d.ts +0 -28
  108. package/esm/operations/list.d.ts.map +0 -1
  109. package/esm/operations/list.js +0 -54
  110. package/esm/operations/list.js.map +0 -1
  111. package/esm/operations/listConsole.d.ts +0 -28
  112. package/esm/operations/listConsole.d.ts.map +0 -1
  113. package/esm/operations/listConsole.js +0 -55
  114. package/esm/operations/listConsole.js.map +0 -1
  115. package/src/microsoftSerialConsoleClientContext.ts +0 -68
  116. package/src/models/consoleMappers.ts +0 -12
  117. package/src/models/listConsoleMappers.ts +0 -12
  118. package/src/models/listMappers.ts +0 -12
  119. package/src/operations/console.ts +0 -126
  120. package/src/operations/list.ts +0 -77
  121. package/src/operations/listConsole.ts +0 -78
package/dist/index.js ADDED
@@ -0,0 +1,861 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var coreClient = require('@azure/core-client');
6
+
7
+ /*
8
+ * Copyright (c) Microsoft Corporation.
9
+ * Licensed under the MIT License.
10
+ *
11
+ * Code generated by Microsoft (R) AutoRest Code Generator.
12
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
13
+ */
14
+ const SerialConsoleOperations = {
15
+ type: {
16
+ name: "Composite",
17
+ className: "SerialConsoleOperations",
18
+ modelProperties: {
19
+ value: {
20
+ serializedName: "value",
21
+ type: {
22
+ name: "Sequence",
23
+ element: {
24
+ type: {
25
+ name: "Composite",
26
+ className: "SerialConsoleOperationsValueItem"
27
+ }
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+ };
34
+ const SerialConsoleOperationsValueItem = {
35
+ type: {
36
+ name: "Composite",
37
+ className: "SerialConsoleOperationsValueItem",
38
+ modelProperties: {
39
+ name: {
40
+ serializedName: "name",
41
+ type: {
42
+ name: "String"
43
+ }
44
+ },
45
+ isDataAction: {
46
+ serializedName: "isDataAction",
47
+ type: {
48
+ name: "String"
49
+ }
50
+ },
51
+ display: {
52
+ serializedName: "display",
53
+ type: {
54
+ name: "Composite",
55
+ className: "SerialConsoleOperationsValueItemDisplay"
56
+ }
57
+ }
58
+ }
59
+ }
60
+ };
61
+ const SerialConsoleOperationsValueItemDisplay = {
62
+ type: {
63
+ name: "Composite",
64
+ className: "SerialConsoleOperationsValueItemDisplay",
65
+ modelProperties: {
66
+ provider: {
67
+ serializedName: "provider",
68
+ type: {
69
+ name: "String"
70
+ }
71
+ },
72
+ resource: {
73
+ serializedName: "resource",
74
+ type: {
75
+ name: "String"
76
+ }
77
+ },
78
+ operation: {
79
+ serializedName: "operation",
80
+ type: {
81
+ name: "String"
82
+ }
83
+ },
84
+ description: {
85
+ serializedName: "description",
86
+ type: {
87
+ name: "String"
88
+ }
89
+ }
90
+ }
91
+ }
92
+ };
93
+ const SerialConsoleStatus = {
94
+ type: {
95
+ name: "Composite",
96
+ className: "SerialConsoleStatus",
97
+ modelProperties: {
98
+ disabled: {
99
+ serializedName: "disabled",
100
+ type: {
101
+ name: "Boolean"
102
+ }
103
+ }
104
+ }
105
+ }
106
+ };
107
+ const GetSerialConsoleSubscriptionNotFound = {
108
+ type: {
109
+ name: "Composite",
110
+ className: "GetSerialConsoleSubscriptionNotFound",
111
+ modelProperties: {
112
+ code: {
113
+ serializedName: "code",
114
+ type: {
115
+ name: "String"
116
+ }
117
+ },
118
+ message: {
119
+ serializedName: "message",
120
+ type: {
121
+ name: "String"
122
+ }
123
+ }
124
+ }
125
+ }
126
+ };
127
+ const DisableSerialConsoleResult = {
128
+ type: {
129
+ name: "Composite",
130
+ className: "DisableSerialConsoleResult",
131
+ modelProperties: {
132
+ disabled: {
133
+ serializedName: "disabled",
134
+ type: {
135
+ name: "Boolean"
136
+ }
137
+ }
138
+ }
139
+ }
140
+ };
141
+ const EnableSerialConsoleResult = {
142
+ type: {
143
+ name: "Composite",
144
+ className: "EnableSerialConsoleResult",
145
+ modelProperties: {
146
+ disabled: {
147
+ serializedName: "disabled",
148
+ type: {
149
+ name: "Boolean"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ };
155
+ const SerialPortListResult = {
156
+ type: {
157
+ name: "Composite",
158
+ className: "SerialPortListResult",
159
+ modelProperties: {
160
+ value: {
161
+ serializedName: "value",
162
+ type: {
163
+ name: "Sequence",
164
+ element: {
165
+ type: {
166
+ name: "Composite",
167
+ className: "SerialPort"
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
174
+ };
175
+ const Resource = {
176
+ type: {
177
+ name: "Composite",
178
+ className: "Resource",
179
+ modelProperties: {
180
+ id: {
181
+ serializedName: "id",
182
+ readOnly: true,
183
+ type: {
184
+ name: "String"
185
+ }
186
+ },
187
+ name: {
188
+ serializedName: "name",
189
+ readOnly: true,
190
+ type: {
191
+ name: "String"
192
+ }
193
+ },
194
+ type: {
195
+ serializedName: "type",
196
+ readOnly: true,
197
+ type: {
198
+ name: "String"
199
+ }
200
+ }
201
+ }
202
+ }
203
+ };
204
+ const CloudError = {
205
+ type: {
206
+ name: "Composite",
207
+ className: "CloudError",
208
+ modelProperties: {
209
+ error: {
210
+ serializedName: "error",
211
+ type: {
212
+ name: "Composite",
213
+ className: "CloudErrorBody"
214
+ }
215
+ }
216
+ }
217
+ }
218
+ };
219
+ const CloudErrorBody = {
220
+ type: {
221
+ name: "Composite",
222
+ className: "CloudErrorBody",
223
+ modelProperties: {
224
+ code: {
225
+ serializedName: "code",
226
+ type: {
227
+ name: "String"
228
+ }
229
+ },
230
+ message: {
231
+ serializedName: "message",
232
+ type: {
233
+ name: "String"
234
+ }
235
+ },
236
+ target: {
237
+ serializedName: "target",
238
+ type: {
239
+ name: "String"
240
+ }
241
+ },
242
+ details: {
243
+ serializedName: "details",
244
+ type: {
245
+ name: "Sequence",
246
+ element: {
247
+ type: {
248
+ name: "Composite",
249
+ className: "CloudErrorBody"
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
255
+ }
256
+ };
257
+ const SerialPortConnectResult = {
258
+ type: {
259
+ name: "Composite",
260
+ className: "SerialPortConnectResult",
261
+ modelProperties: {
262
+ connectionString: {
263
+ serializedName: "connectionString",
264
+ type: {
265
+ name: "String"
266
+ }
267
+ }
268
+ }
269
+ }
270
+ };
271
+ const ProxyResource = {
272
+ type: {
273
+ name: "Composite",
274
+ className: "ProxyResource",
275
+ modelProperties: Object.assign({}, Resource.type.modelProperties)
276
+ }
277
+ };
278
+ const SerialPort = {
279
+ type: {
280
+ name: "Composite",
281
+ className: "SerialPort",
282
+ modelProperties: Object.assign(Object.assign({}, ProxyResource.type.modelProperties), { state: {
283
+ serializedName: "properties.state",
284
+ type: {
285
+ name: "Enum",
286
+ allowedValues: ["enabled", "disabled"]
287
+ }
288
+ } })
289
+ }
290
+ };
291
+
292
+ var Mappers = /*#__PURE__*/Object.freeze({
293
+ __proto__: null,
294
+ SerialConsoleOperations: SerialConsoleOperations,
295
+ SerialConsoleOperationsValueItem: SerialConsoleOperationsValueItem,
296
+ SerialConsoleOperationsValueItemDisplay: SerialConsoleOperationsValueItemDisplay,
297
+ SerialConsoleStatus: SerialConsoleStatus,
298
+ GetSerialConsoleSubscriptionNotFound: GetSerialConsoleSubscriptionNotFound,
299
+ DisableSerialConsoleResult: DisableSerialConsoleResult,
300
+ EnableSerialConsoleResult: EnableSerialConsoleResult,
301
+ SerialPortListResult: SerialPortListResult,
302
+ Resource: Resource,
303
+ CloudError: CloudError,
304
+ CloudErrorBody: CloudErrorBody,
305
+ SerialPortConnectResult: SerialPortConnectResult,
306
+ ProxyResource: ProxyResource,
307
+ SerialPort: SerialPort
308
+ });
309
+
310
+ /*
311
+ * Copyright (c) Microsoft Corporation.
312
+ * Licensed under the MIT License.
313
+ *
314
+ * Code generated by Microsoft (R) AutoRest Code Generator.
315
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
316
+ */
317
+ const accept = {
318
+ parameterPath: "accept",
319
+ mapper: {
320
+ defaultValue: "application/json",
321
+ isConstant: true,
322
+ serializedName: "Accept",
323
+ type: {
324
+ name: "String"
325
+ }
326
+ }
327
+ };
328
+ const $host = {
329
+ parameterPath: "$host",
330
+ mapper: {
331
+ serializedName: "$host",
332
+ required: true,
333
+ type: {
334
+ name: "String"
335
+ }
336
+ },
337
+ skipEncoding: true
338
+ };
339
+ const apiVersion = {
340
+ parameterPath: "apiVersion",
341
+ mapper: {
342
+ defaultValue: "2018-05-01",
343
+ isConstant: true,
344
+ serializedName: "api-version",
345
+ type: {
346
+ name: "String"
347
+ }
348
+ }
349
+ };
350
+ const subscriptionId = {
351
+ parameterPath: "subscriptionId",
352
+ mapper: {
353
+ serializedName: "subscriptionId",
354
+ required: true,
355
+ type: {
356
+ name: "String"
357
+ }
358
+ }
359
+ };
360
+ const defaultParam = {
361
+ parameterPath: "defaultParam",
362
+ mapper: {
363
+ serializedName: "default",
364
+ required: true,
365
+ type: {
366
+ name: "String"
367
+ }
368
+ }
369
+ };
370
+ const resourceGroupName = {
371
+ parameterPath: "resourceGroupName",
372
+ mapper: {
373
+ serializedName: "resourceGroupName",
374
+ required: true,
375
+ type: {
376
+ name: "String"
377
+ }
378
+ }
379
+ };
380
+ const resourceProviderNamespace = {
381
+ parameterPath: "resourceProviderNamespace",
382
+ mapper: {
383
+ serializedName: "resourceProviderNamespace",
384
+ required: true,
385
+ type: {
386
+ name: "String"
387
+ }
388
+ }
389
+ };
390
+ const parentResourceType = {
391
+ parameterPath: "parentResourceType",
392
+ mapper: {
393
+ serializedName: "parentResourceType",
394
+ required: true,
395
+ type: {
396
+ name: "String"
397
+ }
398
+ },
399
+ skipEncoding: true
400
+ };
401
+ const parentResource = {
402
+ parameterPath: "parentResource",
403
+ mapper: {
404
+ serializedName: "parentResource",
405
+ required: true,
406
+ type: {
407
+ name: "String"
408
+ }
409
+ }
410
+ };
411
+ const serialPort = {
412
+ parameterPath: "serialPort",
413
+ mapper: {
414
+ serializedName: "serialPort",
415
+ required: true,
416
+ type: {
417
+ name: "String"
418
+ }
419
+ }
420
+ };
421
+ const contentType = {
422
+ parameterPath: ["options", "contentType"],
423
+ mapper: {
424
+ defaultValue: "application/json",
425
+ isConstant: true,
426
+ serializedName: "Content-Type",
427
+ type: {
428
+ name: "String"
429
+ }
430
+ }
431
+ };
432
+ const parameters = {
433
+ parameterPath: "parameters",
434
+ mapper: SerialPort
435
+ };
436
+
437
+ /*
438
+ * Copyright (c) Microsoft Corporation.
439
+ * Licensed under the MIT License.
440
+ *
441
+ * Code generated by Microsoft (R) AutoRest Code Generator.
442
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
443
+ */
444
+ /** Class containing SerialPorts operations. */
445
+ class SerialPortsImpl {
446
+ /**
447
+ * Initialize a new instance of the class SerialPorts class.
448
+ * @param client Reference to the service client
449
+ */
450
+ constructor(client) {
451
+ this.client = client;
452
+ }
453
+ /**
454
+ * Lists all of the configured serial ports for a parent resource
455
+ * @param resourceGroupName The name of the resource group.
456
+ * @param resourceProviderNamespace The namespace of the resource provider.
457
+ * @param parentResourceType The resource type of the parent resource. For example: 'virtualMachines'
458
+ * or 'virtualMachineScaleSets'
459
+ * @param parentResource The resource name, or subordinate path, for the parent of the serial port. For
460
+ * example: the name of the virtual machine.
461
+ * @param options The options parameters.
462
+ */
463
+ list(resourceGroupName, resourceProviderNamespace, parentResourceType, parentResource, options) {
464
+ return this.client.sendOperationRequest({
465
+ resourceGroupName,
466
+ resourceProviderNamespace,
467
+ parentResourceType,
468
+ parentResource,
469
+ options
470
+ }, listOperationSpec);
471
+ }
472
+ /**
473
+ * Gets the configured settings for a serial port
474
+ * @param resourceGroupName The name of the resource group.
475
+ * @param resourceProviderNamespace The namespace of the resource provider.
476
+ * @param parentResourceType The resource type of the parent resource. For example: 'virtualMachines'
477
+ * or 'virtualMachineScaleSets'
478
+ * @param parentResource The resource name, or subordinate path, for the parent of the serial port. For
479
+ * example: the name of the virtual machine.
480
+ * @param serialPort The name of the serial port to connect to.
481
+ * @param options The options parameters.
482
+ */
483
+ get(resourceGroupName, resourceProviderNamespace, parentResourceType, parentResource, serialPort, options) {
484
+ return this.client.sendOperationRequest({
485
+ resourceGroupName,
486
+ resourceProviderNamespace,
487
+ parentResourceType,
488
+ parentResource,
489
+ serialPort,
490
+ options
491
+ }, getOperationSpec);
492
+ }
493
+ /**
494
+ * Creates or updates a serial port
495
+ * @param resourceGroupName The name of the resource group.
496
+ * @param resourceProviderNamespace The namespace of the resource provider.
497
+ * @param parentResourceType The resource type of the parent resource. For example: 'virtualMachines'
498
+ * or 'virtualMachineScaleSets'
499
+ * @param parentResource The resource name, or subordinate path, for the parent of the serial port. For
500
+ * example: the name of the virtual machine.
501
+ * @param serialPort The name of the serial port to create.
502
+ * @param parameters Parameters supplied to create the serial port.
503
+ * @param options The options parameters.
504
+ */
505
+ create(resourceGroupName, resourceProviderNamespace, parentResourceType, parentResource, serialPort, parameters, options) {
506
+ return this.client.sendOperationRequest({
507
+ resourceGroupName,
508
+ resourceProviderNamespace,
509
+ parentResourceType,
510
+ parentResource,
511
+ serialPort,
512
+ parameters,
513
+ options
514
+ }, createOperationSpec);
515
+ }
516
+ /**
517
+ * Deletes a serial port
518
+ * @param resourceGroupName The name of the resource group.
519
+ * @param resourceProviderNamespace The namespace of the resource provider.
520
+ * @param parentResourceType The resource type of the parent resource. For example: 'virtualMachines'
521
+ * or 'virtualMachineScaleSets'
522
+ * @param parentResource The resource name, or subordinate path, for the parent of the serial port. For
523
+ * example: the name of the virtual machine.
524
+ * @param serialPort The name of the serial port to delete.
525
+ * @param options The options parameters.
526
+ */
527
+ delete(resourceGroupName, resourceProviderNamespace, parentResourceType, parentResource, serialPort, options) {
528
+ return this.client.sendOperationRequest({
529
+ resourceGroupName,
530
+ resourceProviderNamespace,
531
+ parentResourceType,
532
+ parentResource,
533
+ serialPort,
534
+ options
535
+ }, deleteOperationSpec);
536
+ }
537
+ /**
538
+ * Handles requests to list all SerialPort resources in a subscription.
539
+ * @param options The options parameters.
540
+ */
541
+ listBySubscriptions(options) {
542
+ return this.client.sendOperationRequest({ options }, listBySubscriptionsOperationSpec);
543
+ }
544
+ /**
545
+ * Connect to serial port of the target resource
546
+ * @param resourceGroupName The name of the resource group.
547
+ * @param resourceProviderNamespace The namespace of the resource provider.
548
+ * @param parentResourceType The resource type of the parent resource. For example: 'virtualMachines'
549
+ * or 'virtualMachineScaleSets'
550
+ * @param parentResource The resource name, or subordinate path, for the parent of the serial port. For
551
+ * example: the name of the virtual machine.
552
+ * @param serialPort The name of the serial port to connect to.
553
+ * @param options The options parameters.
554
+ */
555
+ connect(resourceGroupName, resourceProviderNamespace, parentResourceType, parentResource, serialPort, options) {
556
+ return this.client.sendOperationRequest({
557
+ resourceGroupName,
558
+ resourceProviderNamespace,
559
+ parentResourceType,
560
+ parentResource,
561
+ serialPort,
562
+ options
563
+ }, connectOperationSpec);
564
+ }
565
+ }
566
+ // Operation Specifications
567
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
568
+ const listOperationSpec = {
569
+ path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourceType}/{parentResource}/providers/Microsoft.SerialConsole/serialPorts",
570
+ httpMethod: "GET",
571
+ responses: {
572
+ 200: {
573
+ bodyMapper: SerialPortListResult
574
+ },
575
+ default: {
576
+ bodyMapper: CloudError
577
+ }
578
+ },
579
+ queryParameters: [apiVersion],
580
+ urlParameters: [
581
+ $host,
582
+ subscriptionId,
583
+ resourceGroupName,
584
+ resourceProviderNamespace,
585
+ parentResourceType,
586
+ parentResource
587
+ ],
588
+ headerParameters: [accept],
589
+ serializer
590
+ };
591
+ const getOperationSpec = {
592
+ path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourceType}/{parentResource}/providers/Microsoft.SerialConsole/serialPorts/{serialPort}",
593
+ httpMethod: "GET",
594
+ responses: {
595
+ 200: {
596
+ bodyMapper: SerialPort
597
+ },
598
+ default: {
599
+ bodyMapper: CloudError
600
+ }
601
+ },
602
+ queryParameters: [apiVersion],
603
+ urlParameters: [
604
+ $host,
605
+ subscriptionId,
606
+ resourceGroupName,
607
+ resourceProviderNamespace,
608
+ parentResourceType,
609
+ parentResource,
610
+ serialPort
611
+ ],
612
+ headerParameters: [accept],
613
+ serializer
614
+ };
615
+ const createOperationSpec = {
616
+ path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourceType}/{parentResource}/providers/Microsoft.SerialConsole/serialPorts/{serialPort}",
617
+ httpMethod: "PUT",
618
+ responses: {
619
+ 201: {
620
+ bodyMapper: SerialPort
621
+ },
622
+ default: {
623
+ bodyMapper: CloudError
624
+ }
625
+ },
626
+ requestBody: parameters,
627
+ queryParameters: [apiVersion],
628
+ urlParameters: [
629
+ $host,
630
+ subscriptionId,
631
+ resourceGroupName,
632
+ resourceProviderNamespace,
633
+ parentResourceType,
634
+ parentResource,
635
+ serialPort
636
+ ],
637
+ headerParameters: [accept, contentType],
638
+ mediaType: "json",
639
+ serializer
640
+ };
641
+ const deleteOperationSpec = {
642
+ path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourceType}/{parentResource}/providers/Microsoft.SerialConsole/serialPorts/{serialPort}",
643
+ httpMethod: "DELETE",
644
+ responses: {
645
+ 200: {},
646
+ 204: {},
647
+ default: {
648
+ bodyMapper: CloudError
649
+ }
650
+ },
651
+ queryParameters: [apiVersion],
652
+ urlParameters: [
653
+ $host,
654
+ subscriptionId,
655
+ resourceGroupName,
656
+ resourceProviderNamespace,
657
+ parentResourceType,
658
+ parentResource,
659
+ serialPort
660
+ ],
661
+ headerParameters: [accept],
662
+ serializer
663
+ };
664
+ const listBySubscriptionsOperationSpec = {
665
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/serialPorts",
666
+ httpMethod: "GET",
667
+ responses: {
668
+ 200: {
669
+ bodyMapper: SerialPortListResult
670
+ },
671
+ default: {
672
+ bodyMapper: CloudError
673
+ }
674
+ },
675
+ urlParameters: [$host, subscriptionId],
676
+ headerParameters: [accept],
677
+ serializer
678
+ };
679
+ const connectOperationSpec = {
680
+ path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourceType}/{parentResource}/providers/Microsoft.SerialConsole/serialPorts/{serialPort}/connect",
681
+ httpMethod: "POST",
682
+ responses: {
683
+ 200: {
684
+ bodyMapper: SerialPortConnectResult
685
+ },
686
+ default: {
687
+ bodyMapper: CloudError
688
+ }
689
+ },
690
+ queryParameters: [apiVersion],
691
+ urlParameters: [
692
+ $host,
693
+ subscriptionId,
694
+ resourceGroupName,
695
+ resourceProviderNamespace,
696
+ parentResourceType,
697
+ parentResource,
698
+ serialPort
699
+ ],
700
+ headerParameters: [accept],
701
+ serializer
702
+ };
703
+
704
+ /*
705
+ * Copyright (c) Microsoft Corporation.
706
+ * Licensed under the MIT License.
707
+ *
708
+ * Code generated by Microsoft (R) AutoRest Code Generator.
709
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
710
+ */
711
+ class MicrosoftSerialConsoleClient extends coreClient.ServiceClient {
712
+ /**
713
+ * Initializes a new instance of the MicrosoftSerialConsoleClient class.
714
+ * @param credentials Subscription credentials which uniquely identify client subscription.
715
+ * @param subscriptionId Subscription ID which uniquely identifies the Microsoft Azure subscription.
716
+ * The subscription ID forms part of the URI for every service call requiring it.
717
+ * @param options The parameter options
718
+ */
719
+ constructor(credentials, subscriptionId, options) {
720
+ if (credentials === undefined) {
721
+ throw new Error("'credentials' cannot be null");
722
+ }
723
+ if (subscriptionId === undefined) {
724
+ throw new Error("'subscriptionId' cannot be null");
725
+ }
726
+ // Initializing default values for options
727
+ if (!options) {
728
+ options = {};
729
+ }
730
+ const defaults = {
731
+ requestContentType: "application/json; charset=utf-8",
732
+ credential: credentials
733
+ };
734
+ const packageDetails = `azsdk-js-arm-serialconsole/2.0.0`;
735
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
736
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
737
+ : `${packageDetails}`;
738
+ if (!options.credentialScopes) {
739
+ options.credentialScopes = ["https://management.azure.com/.default"];
740
+ }
741
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
742
+ userAgentPrefix
743
+ }, baseUri: options.endpoint || "https://management.azure.com" });
744
+ super(optionsWithDefaults);
745
+ // Parameter assignments
746
+ this.subscriptionId = subscriptionId;
747
+ // Assigning values to Constant parameters
748
+ this.$host = options.$host || "https://management.azure.com";
749
+ this.apiVersion = options.apiVersion || "2018-05-01";
750
+ this.serialPorts = new SerialPortsImpl(this);
751
+ }
752
+ /**
753
+ * Gets a list of Serial Console API operations.
754
+ * @param options The options parameters.
755
+ */
756
+ listOperations(options) {
757
+ return this.sendOperationRequest({ options }, listOperationsOperationSpec);
758
+ }
759
+ /**
760
+ * Gets whether or not Serial Console is disabled for a given subscription
761
+ * @param defaultParam Default parameter. Leave the value as "default".
762
+ * @param options The options parameters.
763
+ */
764
+ getConsoleStatus(defaultParam, options) {
765
+ return this.sendOperationRequest({ defaultParam, options }, getConsoleStatusOperationSpec);
766
+ }
767
+ /**
768
+ * Disables the Serial Console service for all VMs and VM scale sets in the provided subscription
769
+ * @param defaultParam Default parameter. Leave the value as "default".
770
+ * @param options The options parameters.
771
+ */
772
+ disableConsole(defaultParam, options) {
773
+ return this.sendOperationRequest({ defaultParam, options }, disableConsoleOperationSpec);
774
+ }
775
+ /**
776
+ * Enables the Serial Console service for all VMs and VM scale sets in the provided subscription
777
+ * @param defaultParam Default parameter. Leave the value as "default".
778
+ * @param options The options parameters.
779
+ */
780
+ enableConsole(defaultParam, options) {
781
+ return this.sendOperationRequest({ defaultParam, options }, enableConsoleOperationSpec);
782
+ }
783
+ }
784
+ // Operation Specifications
785
+ const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
786
+ const listOperationsOperationSpec = {
787
+ path: "/providers/Microsoft.SerialConsole/operations",
788
+ httpMethod: "GET",
789
+ responses: {
790
+ 200: {
791
+ bodyMapper: SerialConsoleOperations
792
+ }
793
+ },
794
+ queryParameters: [apiVersion],
795
+ urlParameters: [$host],
796
+ headerParameters: [accept],
797
+ serializer: serializer$1
798
+ };
799
+ const getConsoleStatusOperationSpec = {
800
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}",
801
+ httpMethod: "GET",
802
+ responses: {
803
+ 200: {
804
+ bodyMapper: SerialConsoleStatus
805
+ },
806
+ 404: {
807
+ bodyMapper: GetSerialConsoleSubscriptionNotFound
808
+ }
809
+ },
810
+ queryParameters: [apiVersion],
811
+ urlParameters: [
812
+ $host,
813
+ subscriptionId,
814
+ defaultParam
815
+ ],
816
+ headerParameters: [accept],
817
+ serializer: serializer$1
818
+ };
819
+ const disableConsoleOperationSpec = {
820
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole",
821
+ httpMethod: "POST",
822
+ responses: {
823
+ 200: {
824
+ bodyMapper: DisableSerialConsoleResult
825
+ },
826
+ 404: {
827
+ bodyMapper: GetSerialConsoleSubscriptionNotFound
828
+ }
829
+ },
830
+ queryParameters: [apiVersion],
831
+ urlParameters: [
832
+ $host,
833
+ subscriptionId,
834
+ defaultParam
835
+ ],
836
+ headerParameters: [accept],
837
+ serializer: serializer$1
838
+ };
839
+ const enableConsoleOperationSpec = {
840
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole",
841
+ httpMethod: "POST",
842
+ responses: {
843
+ 200: {
844
+ bodyMapper: EnableSerialConsoleResult
845
+ },
846
+ 404: {
847
+ bodyMapper: GetSerialConsoleSubscriptionNotFound
848
+ }
849
+ },
850
+ queryParameters: [apiVersion],
851
+ urlParameters: [
852
+ $host,
853
+ subscriptionId,
854
+ defaultParam
855
+ ],
856
+ headerParameters: [accept],
857
+ serializer: serializer$1
858
+ };
859
+
860
+ exports.MicrosoftSerialConsoleClient = MicrosoftSerialConsoleClient;
861
+ //# sourceMappingURL=index.js.map