-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
index.ts
14421 lines (13798 loc) · 513 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { BaseResource, CloudError } from "@azure/ms-rest-azure-js";
import * as msRest from "@azure/ms-rest-js";
export { BaseResource, CloudError };
/**
* An interface representing PoolUsageMetrics.
* @summary Usage metrics for a Pool across an aggregation interval.
*/
export interface PoolUsageMetrics {
/**
* The ID of the Pool whose metrics are aggregated in this entry.
*/
poolId: string;
/**
* The start time of the aggregation interval covered by this entry.
*/
startTime: Date;
/**
* The end time of the aggregation interval covered by this entry.
*/
endTime: Date;
/**
* The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information
* about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in
* an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes).
*/
vmSize: string;
/**
* The total core hours used in the Pool during this aggregation interval.
*/
totalCoreHours: number;
}
/**
* An interface representing ImageReference.
* @summary A reference to an Azure Virtual Machines Marketplace Image or a Azure Compute Gallery
* Image. To get the list of all Azure Marketplace Image references verified by Azure Batch, see
* the 'List Supported Images' operation.
*/
export interface ImageReference {
/**
* The publisher of the Azure Virtual Machines Marketplace Image. For example, Canonical or
* MicrosoftWindowsServer.
*/
publisher?: string;
/**
* The offer type of the Azure Virtual Machines Marketplace Image. For example, UbuntuServer or
* WindowsServer.
*/
offer?: string;
/**
* The SKU of the Azure Virtual Machines Marketplace Image. For example, 18.04-LTS or
* 2019-Datacenter.
*/
sku?: string;
/**
* The version of the Azure Virtual Machines Marketplace Image. A value of 'latest' can be
* specified to select the latest version of an Image. If omitted, the default is 'latest'.
*/
version?: string;
/**
* The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will
* be created using this Image Id. This is of the form
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId}
* or
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}
* for always defaulting to the latest image version. This property is mutually exclusive with
* other ImageReference properties. The Azure Compute Gallery Image must have replicas in the
* same region and must be in the same subscription as the Azure Batch account. If the image
* version is not specified in the imageId, the latest version will be used. For information
* about the firewall settings for the Batch Compute Node agent to communicate with the Batch
* service see
* https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
*/
virtualMachineImageId?: string;
/**
* The specific version of the platform image or marketplace image used to create the node. This
* read-only field differs from 'version' only if the value specified for 'version' when the pool
* was created was 'latest'.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly exactVersion?: string;
}
/**
* An interface representing ImageInformation.
* @summary A reference to the Azure Virtual Machines Marketplace Image and additional information
* about the Image.
*/
export interface ImageInformation {
/**
* The ID of the Compute Node agent SKU which the Image supports.
*/
nodeAgentSKUId: string;
/**
* The reference to the Azure Virtual Machine's Marketplace Image.
*/
imageReference: ImageReference;
/**
* The type of operating system (e.g. Windows or Linux) of the Image. Possible values include:
* 'linux', 'windows'
*/
osType: OSType;
/**
* The capabilities or features which the Image supports. Not every capability of the Image is
* listed. Capabilities in this list are considered of special interest and are generally related
* to integration with other features in the Azure Batch service.
*/
capabilities?: string[];
/**
* The time when the Azure Batch service will stop accepting create Pool requests for the Image.
*/
batchSupportEndOfLife?: Date;
/**
* Whether the Azure Batch service actively verifies that the Image is compatible with the
* associated Compute Node agent SKU. Possible values include: 'verified', 'unverified'
*/
verificationType: VerificationType;
}
/**
* An interface representing AuthenticationTokenSettings.
* @summary The settings for an authentication token that the Task can use to perform Batch service
* operations.
*/
export interface AuthenticationTokenSettings {
/**
* The Batch resources to which the token grants access. The authentication token grants access
* to a limited set of Batch service operations. Currently the only supported value for the
* access property is 'job', which grants access to all operations related to the Job which
* contains the Task.
*/
access?: AccessScope[];
}
/**
* An interface representing UsageStatistics.
* @summary Statistics related to Pool usage information.
*/
export interface UsageStatistics {
/**
* The start time of the time range covered by the statistics.
*/
startTime: Date;
/**
* The time at which the statistics were last updated. All statistics are limited to the range
* between startTime and lastUpdateTime.
*/
lastUpdateTime: Date;
/**
* The aggregated wall-clock time of the dedicated Compute Node cores being part of the Pool.
*/
dedicatedCoreTime: string;
}
/**
* An interface representing ResourceStatistics.
* @summary Statistics related to resource consumption by Compute Nodes in a Pool.
*/
export interface ResourceStatistics {
/**
* The start time of the time range covered by the statistics.
*/
startTime: Date;
/**
* The time at which the statistics were last updated. All statistics are limited to the range
* between startTime and lastUpdateTime.
*/
lastUpdateTime: Date;
/**
* The average CPU usage across all Compute Nodes in the Pool (percentage per node).
*/
avgCPUPercentage: number;
/**
* The average memory usage in GiB across all Compute Nodes in the Pool.
*/
avgMemoryGiB: number;
/**
* The peak memory usage in GiB across all Compute Nodes in the Pool.
*/
peakMemoryGiB: number;
/**
* The average used disk space in GiB across all Compute Nodes in the Pool.
*/
avgDiskGiB: number;
/**
* The peak used disk space in GiB across all Compute Nodes in the Pool.
*/
peakDiskGiB: number;
/**
* The total number of disk read operations across all Compute Nodes in the Pool.
*/
diskReadIOps: number;
/**
* The total number of disk write operations across all Compute Nodes in the Pool.
*/
diskWriteIOps: number;
/**
* The total amount of data in GiB of disk reads across all Compute Nodes in the Pool.
*/
diskReadGiB: number;
/**
* The total amount of data in GiB of disk writes across all Compute Nodes in the Pool.
*/
diskWriteGiB: number;
/**
* The total amount of data in GiB of network reads across all Compute Nodes in the Pool.
*/
networkReadGiB: number;
/**
* The total amount of data in GiB of network writes across all Compute Nodes in the Pool.
*/
networkWriteGiB: number;
}
/**
* An interface representing PoolStatistics.
* @summary Contains utilization and resource usage statistics for the lifetime of a Pool.
*/
export interface PoolStatistics {
/**
* The URL for the statistics.
*/
url: string;
/**
* The start time of the time range covered by the statistics.
*/
startTime: Date;
/**
* The time at which the statistics were last updated. All statistics are limited to the range
* between startTime and lastUpdateTime.
*/
lastUpdateTime: Date;
/**
* Statistics related to Pool usage, such as the amount of core-time used.
*/
usageStats?: UsageStatistics;
/**
* Statistics related to resource consumption by Compute Nodes in the Pool.
*/
resourceStats?: ResourceStatistics;
}
/**
* An interface representing JobStatistics.
* @summary Resource usage statistics for a Job.
*/
export interface JobStatistics {
/**
* The URL of the statistics.
*/
url: string;
/**
* The start time of the time range covered by the statistics.
*/
startTime: Date;
/**
* The time at which the statistics were last updated. All statistics are limited to the range
* between startTime and lastUpdateTime.
*/
lastUpdateTime: Date;
/**
* The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all
* Tasks in the Job.
*/
userCPUTime: string;
/**
* The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all
* Tasks in the Job.
*/
kernelCPUTime: string;
/**
* The total wall clock time of all Tasks in the Job. The wall clock time is the elapsed time
* from when the Task started running on a Compute Node to when it finished (or to the last time
* the statistics were updated, if the Task had not finished by then). If a Task was retried,
* this includes the wall clock time of all the Task retries.
*/
wallClockTime: string;
/**
* The total number of disk read operations made by all Tasks in the Job.
*/
readIOps: number;
/**
* The total number of disk write operations made by all Tasks in the Job.
*/
writeIOps: number;
/**
* The total amount of data in GiB read from disk by all Tasks in the Job.
*/
readIOGiB: number;
/**
* The total amount of data in GiB written to disk by all Tasks in the Job.
*/
writeIOGiB: number;
/**
* The total number of Tasks successfully completed in the Job during the given time range. A
* Task completes successfully if it returns exit code 0.
*/
numSucceededTasks: number;
/**
* The total number of Tasks in the Job that failed during the given time range. A Task fails if
* it exhausts its maximum retry count without returning exit code 0.
*/
numFailedTasks: number;
/**
* The total number of retries on all the Tasks in the Job during the given time range.
*/
numTaskRetries: number;
/**
* The total wait time of all Tasks in the Job. The wait time for a Task is defined as the
* elapsed time between the creation of the Task and the start of Task execution. (If the Task is
* retried due to failures, the wait time is the time to the most recent Task execution.) This
* value is only reported in the Account lifetime statistics; it is not included in the Job
* statistics.
*/
waitTime: string;
}
/**
* An interface representing NameValuePair.
* @summary Represents a name-value pair.
*/
export interface NameValuePair {
/**
* The name in the name-value pair.
*/
name?: string;
/**
* The value in the name-value pair.
*/
value?: string;
}
/**
* An interface representing DeleteCertificateError.
* @summary An error encountered by the Batch service when deleting a Certificate.
*/
export interface DeleteCertificateError {
/**
* An identifier for the Certificate deletion error. Codes are invariant and are intended to be
* consumed programmatically.
*/
code?: string;
/**
* A message describing the Certificate deletion error, intended to be suitable for display in a
* user interface.
*/
message?: string;
/**
* A list of additional error details related to the Certificate deletion error. This list
* includes details such as the active Pools and Compute Nodes referencing this Certificate.
* However, if a large number of resources reference the Certificate, the list contains only
* about the first hundred.
*/
values?: NameValuePair[];
}
/**
* A Certificate that can be installed on Compute Nodes and can be used to authenticate operations
* on the machine.
*/
export interface Certificate {
/**
* The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits.
*/
thumbprint?: string;
/**
* The algorithm used to derive the thumbprint.
*/
thumbprintAlgorithm?: string;
/**
* The URL of the Certificate.
*/
url?: string;
/**
* The current state of the Certificate. Possible values include: 'active', 'deleting',
* 'deleteFailed'
*/
state?: CertificateState;
/**
* The time at which the Certificate entered its current state.
*/
stateTransitionTime?: Date;
/**
* The previous state of the Certificate. This property is not set if the Certificate is in its
* initial active state. Possible values include: 'active', 'deleting', 'deleteFailed'
*/
previousState?: CertificateState;
/**
* The time at which the Certificate entered its previous state. This property is not set if the
* Certificate is in its initial Active state.
*/
previousStateTransitionTime?: Date;
/**
* The public part of the Certificate as a base-64 encoded .cer file.
*/
publicData?: string;
/**
* The error that occurred on the last attempt to delete this Certificate. This property is set
* only if the Certificate is in the DeleteFailed state.
*/
deleteCertificateError?: DeleteCertificateError;
}
/**
* An interface representing ApplicationPackageReference.
* @summary A reference to an Package to be deployed to Compute Nodes.
*/
export interface ApplicationPackageReference {
/**
* The ID of the application to deploy. When creating a pool, the package's application ID must
* be fully qualified
* (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}).
*/
applicationId: string;
/**
* The version of the application to deploy. If omitted, the default version is deployed. If this
* is omitted on a Pool, and no default version is specified for this application, the request
* fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If
* this is omitted on a Task, and no default version is specified for this application, the Task
* fails with a pre-processing error.
*/
version?: string;
}
/**
* An interface representing ApplicationSummary.
* @summary Contains information about an application in an Azure Batch Account.
*/
export interface ApplicationSummary {
/**
* A string that uniquely identifies the application within the Account.
*/
id: string;
/**
* The display name for the application.
*/
displayName: string;
/**
* The list of available versions of the application.
*/
versions: string[];
}
/**
* An interface representing CertificateAddParameter.
* @summary A Certificate that can be installed on Compute Nodes and can be used to authenticate
* operations on the machine.
*/
export interface CertificateAddParameter {
/**
* The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits (it may
* include spaces but these are removed).
*/
thumbprint: string;
/**
* The algorithm used to derive the thumbprint. This must be sha1.
*/
thumbprintAlgorithm: string;
/**
* The base64-encoded contents of the Certificate. The maximum size is 10KB.
*/
data: string;
/**
* The format of the Certificate data. Possible values include: 'pfx', 'cer'
*/
certificateFormat?: CertificateFormat;
/**
* The password to access the Certificate's private key. This must be omitted if the Certificate
* format is cer.
*/
password?: string;
}
/**
* An interface representing FileProperties.
* @summary The properties of a file on a Compute Node.
*/
export interface FileProperties {
/**
* The file creation time. The creation time is not returned for files on Linux Compute Nodes.
*/
creationTime?: Date;
/**
* The time at which the file was last modified.
*/
lastModified: Date;
/**
* The length of the file.
*/
contentLength: number;
/**
* The content type of the file.
*/
contentType?: string;
/**
* The file mode attribute in octal format. The file mode is returned only for files on Linux
* Compute Nodes.
*/
fileMode?: string;
}
/**
* An interface representing NodeFile.
* @summary Information about a file or directory on a Compute Node.
*/
export interface NodeFile {
/**
* The file path.
*/
name?: string;
/**
* The URL of the file.
*/
url?: string;
/**
* Whether the object represents a directory.
*/
isDirectory?: boolean;
/**
* The file properties.
*/
properties?: FileProperties;
}
/**
* An interface representing Schedule.
* @summary The schedule according to which Jobs will be created. All times are fixed respective to
* UTC and are not impacted by daylight saving time.
*/
export interface Schedule {
/**
* The earliest time at which any Job may be created under this Job Schedule. If you do not
* specify a doNotRunUntil time, the schedule becomes ready to create Jobs immediately.
*/
doNotRunUntil?: Date;
/**
* A time after which no Job will be created under this Job Schedule. The schedule will move to
* the completed state as soon as this deadline is past and there is no active Job under this Job
* Schedule. If you do not specify a doNotRunAfter time, and you are creating a recurring Job
* Schedule, the Job Schedule will remain active until you explicitly terminate it.
*/
doNotRunAfter?: Date;
/**
* The time interval, starting from the time at which the schedule indicates a Job should be
* created, within which a Job must be created. If a Job is not created within the startWindow
* interval, then the 'opportunity' is lost; no Job will be created until the next recurrence of
* the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence
* interval, then this is equivalent to an infinite startWindow, because the Job that is 'due' in
* one recurrenceInterval is not carried forward into the next recurrence interval. The default
* is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service
* rejects the schedule with an error; if you are calling the REST API directly, the HTTP status
* code is 400 (Bad Request).
*/
startWindow?: string;
/**
* The time interval between the start times of two successive Jobs under the Job Schedule. A Job
* Schedule can have at most one active Job under it at any given time. Because a Job Schedule
* can have at most one active Job under it at any given time, if it is time to create a new Job
* under a Job Schedule, but the previous Job is still running, the Batch service will not create
* the new Job until the previous Job finishes. If the previous Job does not finish within the
* startWindow period of the new recurrenceInterval, then no new Job will be scheduled for that
* interval. For recurring Jobs, you should normally specify a jobManagerTask in the
* jobSpecification. If you do not use jobManagerTask, you will need an external process to
* monitor when Jobs are created, add Tasks to the Jobs and terminate the Jobs ready for the next
* recurrence. The default is that the schedule does not recur: one Job is created, within the
* startWindow after the doNotRunUntil time, and the schedule is complete as soon as that Job
* finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service
* rejects the schedule with an error; if you are calling the REST API directly, the HTTP status
* code is 400 (Bad Request).
*/
recurrenceInterval?: string;
}
/**
* An interface representing JobConstraints.
* @summary The execution constraints for a Job.
*/
export interface JobConstraints {
/**
* The maximum elapsed time that the Job may run, measured from the time the Job is created. If
* the Job does not complete within the time limit, the Batch service terminates it and any Tasks
* that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry.
* If this property is not specified, there is no time limit on how long the Job may run.
*/
maxWallClockTime?: string;
/**
* The maximum number of times each Task may be retried. The Batch service retries a Task if its
* exit code is nonzero. Note that this value specifically controls the number of retries. The
* Batch service will try each Task once, and may then retry up to this limit. For example, if
* the maximum retry count is 3, Batch tries a Task up to 4 times (one initial try and 3
* retries). If the maximum retry count is 0, the Batch service does not retry Tasks. If the
* maximum retry count is -1, the Batch service retries Tasks without limit. The default value is
* 0 (no retries).
*/
maxTaskRetryCount?: number;
}
/**
* An interface representing JobNetworkConfiguration.
* @summary The network configuration for the Job.
*/
export interface JobNetworkConfiguration {
/**
* The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks
* from the Job will join for the duration of the Task. This will only work with a
* VirtualMachineConfiguration Pool. The virtual network must be in the same region and
* subscription as the Azure Batch Account. The specified subnet should have enough free IP
* addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This
* can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service
* principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC)
* role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This
* can be verified by checking if the specified VNet has any associated Network Security Groups
* (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the
* Batch service will set the state of the Compute Nodes to unusable. This is of the form
* /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.
* If the specified VNet has any associated Network Security Groups (NSG), then a few reserved
* system ports must be enabled for inbound communication from the Azure Batch service. For Pools
* created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22
* for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound
* connections for communications to Azure Storage. For more details see:
* https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration
*/
subnetId: string;
}
/**
* The reference to a user assigned identity associated with the Batch pool which a compute node
* will use.
*/
export interface ComputeNodeIdentityReference {
/**
* The ARM resource id of the user assigned identity.
*/
resourceId?: string;
}
/**
* An interface representing ContainerRegistry.
* @summary A private container registry.
*/
export interface ContainerRegistry {
/**
* The user name to log into the registry server.
*/
userName?: string;
/**
* The password to log into the registry server.
*/
password?: string;
/**
* The registry URL. If omitted, the default is "docker.io".
*/
registryServer?: string;
/**
* The reference to the user assigned identity to use to access an Azure Container Registry
* instead of username and password.
*/
identityReference?: ComputeNodeIdentityReference;
}
/**
* An interface representing TaskContainerSettings.
* @summary The container settings for a Task.
*/
export interface TaskContainerSettings {
/**
* Additional options to the container create command. These additional options are supplied as
* arguments to the "docker create" command, in addition to those controlled by the Batch
* Service.
*/
containerRunOptions?: string;
/**
* The Image to use to create the container in which the Task will run. This is the full Image
* reference, as would be specified to "docker pull". If no tag is provided as part of the Image
* name, the tag ":latest" is used as a default.
*/
imageName: string;
/**
* The private registry which contains the container Image. This setting can be omitted if was
* already provided at Pool creation.
*/
registry?: ContainerRegistry;
/**
* The location of the container Task working directory. The default is 'taskWorkingDirectory'.
* Possible values include: 'taskWorkingDirectory', 'containerImageDefault'
*/
workingDirectory?: ContainerWorkingDirectory;
}
/**
* An interface representing ResourceFile.
* @summary A single file or multiple files to be downloaded to a Compute Node.
*/
export interface ResourceFile {
/**
* The storage container name in the auto storage Account. The autoStorageContainerName,
* storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be
* specified.
*/
autoStorageContainerName?: string;
/**
* The URL of the blob container within Azure Blob Storage. The autoStorageContainerName,
* storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be
* specified. This URL must be readable and listable from compute nodes. There are three ways to
* get such a URL for a container in Azure storage: include a Shared Access Signature (SAS)
* granting read and list permissions on the container, use a managed identity with read and list
* permissions, or set the ACL for the container to allow public access.
*/
storageContainerUrl?: string;
/**
* The URL of the file to download. The autoStorageContainerName, storageContainerUrl and httpUrl
* properties are mutually exclusive and one of them must be specified. If the URL points to
* Azure Blob Storage, it must be readable from compute nodes. There are three ways to get such a
* URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read
* permissions on the blob, use a managed identity with read permission, or set the ACL for the
* blob or its container to allow public access.
*/
httpUrl?: string;
/**
* The blob prefix to use when downloading blobs from an Azure Storage container. Only the blobs
* whose names begin with the specified prefix will be downloaded. The property is valid only
* when autoStorageContainerName or storageContainerUrl is used. This prefix can be a partial
* filename or a subdirectory. If a prefix is not specified, all the files in the container will
* be downloaded.
*/
blobPrefix?: string;
/**
* The location on the Compute Node to which to download the file(s), relative to the Task's
* working directory. If the httpUrl property is specified, the filePath is required and
* describes the path which the file will be downloaded to, including the filename. Otherwise, if
* the autoStorageContainerName or storageContainerUrl property is specified, filePath is
* optional and is the directory to download the files to. In the case where filePath is used as
* a directory, any directory structure already associated with the input data will be retained
* in full and appended to the specified filePath directory. The specified relative path cannot
* break out of the Task's working directory (for example by using '..').
*/
filePath?: string;
/**
* The file permission mode attribute in octal format. This property applies only to files being
* downloaded to Linux Compute Nodes. It will be ignored if it is specified for a resourceFile
* which will be downloaded to a Windows Compute Node. If this property is not specified for a
* Linux Compute Node, then a default value of 0770 is applied to the file.
*/
fileMode?: string;
/**
* The reference to the user assigned identity to use to access Azure Blob Storage specified by
* storageContainerUrl or httpUrl.
*/
identityReference?: ComputeNodeIdentityReference;
}
/**
* An interface representing EnvironmentSetting.
* @summary An environment variable to be set on a Task process.
*/
export interface EnvironmentSetting {
/**
* The name of the environment variable.
*/
name: string;
/**
* The value of the environment variable.
*/
value?: string;
}
/**
* An interface representing HttpHeader.
* @summary An HTTP header name-value pair
*/
export interface HttpHeader {
/**
* The case-insensitive name of the header to be used while uploading output files.
*/
name: string;
/**
* The value of the header to be used while uploading output files.
*/
value?: string;
}
/**
* An interface representing ExitOptions.
* @summary Specifies how the Batch service responds to a particular exit condition.
*/
export interface ExitOptions {
/**
* An action to take on the Job containing the Task, if the Task completes with the given exit
* condition and the Job's onTaskFailed property is 'performExitOptionsJobAction'. The default is
* none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed
* property is noaction, then specifying this property returns an error and the add Task request
* fails with an invalid property value error; if you are calling the REST API directly, the HTTP
* status code is 400 (Bad Request). Possible values include: 'none', 'disable', 'terminate'
*/
jobAction?: JobAction;
/**
* An action that the Batch service performs on Tasks that depend on this Task. Possible values
* are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to
* wait). Batch does not yet support cancellation of dependent tasks. Possible values include:
* 'satisfy', 'block'
*/
dependencyAction?: DependencyAction;
}
/**
* An interface representing ExitCodeMapping.
* @summary How the Batch service should respond if a Task exits with a particular exit code.
*/
export interface ExitCodeMapping {
/**
* A process exit code.
*/
code: number;
/**
* How the Batch service should respond if the Task exits with this exit code.
*/
exitOptions: ExitOptions;
}
/**
* An interface representing ExitCodeRangeMapping.
* @summary A range of exit codes and how the Batch service should respond to exit codes within
* that range.
*/
export interface ExitCodeRangeMapping {
/**
* The first exit code in the range.
*/
start: number;
/**
* The last exit code in the range.
*/
end: number;
/**
* How the Batch service should respond if the Task exits with an exit code in the range start to
* end (inclusive).
*/
exitOptions: ExitOptions;
}
/**
* An interface representing ExitConditions.
* @summary Specifies how the Batch service should respond when the Task completes.
*/
export interface ExitConditions {
/**
* A list of individual Task exit codes and how the Batch service should respond to them.
*/
exitCodes?: ExitCodeMapping[];
/**
* A list of Task exit code ranges and how the Batch service should respond to them.
*/
exitCodeRanges?: ExitCodeRangeMapping[];
/**
* How the Batch service should respond if the Task fails to start due to an error.
*/
preProcessingError?: ExitOptions;
/**
* How the Batch service should respond if a file upload error occurs. If the Task exited with an
* exit code that was specified via exitCodes or exitCodeRanges, and then encountered a file
* upload error, then the action specified by the exit code takes precedence.
*/
fileUploadError?: ExitOptions;
/**
* How the Batch service should respond if the Task fails with an exit condition not covered by
* any of the other properties. This value is used if the Task exits with any nonzero exit code
* not listed in the exitCodes or exitCodeRanges collection, with a pre-processing error if the
* preProcessingError property is not present, or with a file upload error if the fileUploadError
* property is not present. If you want non-default behavior on exit code 0, you must list it
* explicitly using the exitCodes or exitCodeRanges collection.
*/
default?: ExitOptions;
}
/**
* An interface representing AutoUserSpecification.
* @summary Specifies the parameters for the auto user that runs a Task on the Batch service.
*/
export interface AutoUserSpecification {
/**
* The scope for the auto user. The default value is pool. If the pool is running Windows a value
* of Task should be specified if stricter isolation between tasks is required. For example, if
* the task mutates the registry in a way which could impact other tasks, or if certificates have
* been specified on the pool which should not be accessible by normal tasks but should be
* accessible by StartTasks. Possible values include: 'task', 'pool'
*/
scope?: AutoUserScope;
/**
* The elevation level of the auto user. The default value is nonAdmin. Possible values include:
* 'nonAdmin', 'admin'
*/
elevationLevel?: ElevationLevel;
}
/**
* Specify either the userName or autoUser property, but not both.
* @summary The definition of the user identity under which the Task is run.
*/
export interface UserIdentity {
/**
* The name of the user identity under which the Task is run. The userName and autoUser
* properties are mutually exclusive; you must specify one but not both.
*/
userName?: string;
/**
* The auto user under which the Task is run. The userName and autoUser properties are mutually
* exclusive; you must specify one but not both.
*/
autoUser?: AutoUserSpecification;
}
/**
* An interface representing LinuxUserConfiguration.
* @summary Properties used to create a user Account on a Linux Compute Node.
*/
export interface LinuxUserConfiguration {
/**
* The user ID of the user Account. The uid and gid properties must be specified together or not
* at all. If not specified the underlying operating system picks the uid.
*/
uid?: number;
/**
* The group ID for the user Account. The uid and gid properties must be specified together or
* not at all. If not specified the underlying operating system picks the gid.
*/
gid?: number;
/**
* The SSH private key for the user Account. The private key must not be password protected. The
* private key is used to automatically configure asymmetric-key based authentication for SSH
* between Compute Nodes in a Linux Pool when the Pool's enableInterNodeCommunication property is
* true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key
* pair into the user's .ssh directory. If not specified, password-less SSH is not configured
* between Compute Nodes (no modification of the user's .ssh directory is done).
*/
sshPrivateKey?: string;
}
/**
* An interface representing WindowsUserConfiguration.
* @summary Properties used to create a user Account on a Windows Compute Node.
*/
export interface WindowsUserConfiguration {
/**
* The login mode for the user. The default value for VirtualMachineConfiguration Pools is
* 'batch' and for CloudServiceConfiguration Pools is 'interactive'. Possible values include:
* 'batch', 'interactive'
*/
loginMode?: LoginMode;
}
/**
* An interface representing UserAccount.
* @summary Properties used to create a user used to execute Tasks on an Azure Batch Compute Node.
*/
export interface UserAccount {
/**
* The name of the user Account. Names can contain any Unicode characters up to a maximum length
* of 20.
*/
name: string;
/**
* The password for the user Account.
*/
password: string;
/**
* The elevation level of the user Account. The default value is nonAdmin. Possible values
* include: 'nonAdmin', 'admin'
*/
elevationLevel?: ElevationLevel;
/**
* The Linux-specific user configuration for the user Account. This property is ignored if
* specified on a Windows Pool. If not specified, the user is created with the default options.
*/
linuxUserConfiguration?: LinuxUserConfiguration;
/**
* The Windows-specific user configuration for the user Account. This property can only be
* specified if the user is on a Windows Pool. If not specified and on a Windows Pool, the user
* is created with the default options.
*/
windowsUserConfiguration?: WindowsUserConfiguration;
}
/**
* An interface representing TaskConstraints.
* @summary Execution constraints to apply to a Task.
*/
export interface TaskConstraints {
/**
* The maximum elapsed time that the Task may run, measured from the time the Task starts. If the
* Task does not complete within the time limit, the Batch service terminates it. If this is not