-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy path_models_py3.py
More file actions
2286 lines (2098 loc) · 123 KB
/
_models_py3.py
File metadata and controls
2286 lines (2098 loc) · 123 KB
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. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=too-many-lines
import importlib
import os
from msrest.serialization import Model
from .constants import ATTRS_RESERVED_FOR_TEMPLATES
models_base = "azext.generated.sdk.batch.v2019_08_01.models.{}"
JobAddParameter = importlib.import_module(models_base.format("JobAddParameter"))
PoolAddParameter = importlib.import_module(models_base.format("PoolAddParameter"))
TaskAddParameter = importlib.import_module(models_base.format("TaskAddParameter"))
PoolSpecification = importlib.import_module(models_base.format("PoolSpecification"))
ResourceFile = importlib.import_module(models_base.format("ResourceFile"))
class TaskFactoryBase(Model):
"""A Task Factory for automatically adding a collection of tasks to a job on
submission.
:param merge_task: An optional additional task to be run after all the other
generated tasks have completed successfully.
:type merge_task: :class:`MergeTask <azext.batch.models.MergeTask>`
"""
_validation = {
'type': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'merge_task': {'key': 'mergeTask', 'type': 'MergeTask'}
}
_subtype_map = {
'type': {'parametricSweep': 'ParametricSweepTaskFactory',
'taskPerFile': 'FileCollectionTaskFactory',
'taskCollection': 'TaskCollectionTaskFactory'}
}
def __init__(self, *, merge_task=None, **kwargs) -> None:
super(TaskFactoryBase, self).__init__(**kwargs)
self.merge_task = merge_task
self.type = None
class PackageReferenceBase(Model):
"""A reference to a package to be installed on the compute nodes using
a package manager.
:param str id: The name of the package.
:param str version: The version of the package to be installed. If omitted,
the latest version (according to the package repository) will be installed.
"""
_validation = {
'type': {'required': True},
'id': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
'version': {'key': 'version', 'type': 'str'},
}
_subtype_map = {
'type': {'aptPackage': 'AptPackageReference',
'chocolateyPackage': 'ChocolateyPackageReference',
'yumPackage': 'YumPackageReference'}
}
def __init__(self, *, id: str, version: str=None, **kwargs) -> None:
super(PackageReferenceBase, self).__init__(**kwargs)
self.type = None
self.id = id
self.version = version
class ApplicationTemplateInfo(Model):
"""A reference to an Azure Batch Application Template.
:param str file_path: The path to an application template file. This can
be a full path, or relative to the current working directory. Alternatively
a relative directory can be supplied with the 'current_directory' argument.
A ValueError will be raised if the supplied file path cannot be found.
:param dict parameters: A dictory of parameter names and values to be
subtituted into the application template.
"""
_validation = {
'file_path': {'required': True},
}
_attribute_map = {
'file_path': {'key': 'filePath', 'type': 'str'},
'parameters': {'key': 'parameters', 'type': 'object'},
}
def __init__(self, *, file_path: str, parameters: object=None, current_directory: str=".", **kwargs) -> None:
super(ApplicationTemplateInfo, self).__init__(**kwargs)
self.file_path = file_path
if not os.path.isfile(self.file_path):
current_directory = current_directory
self.file_path = os.path.abspath(os.path.join(current_directory, str(self.file_path)))
self.parameters = parameters
# Rule: Template file must exist
# (We do this in order to give a good diagnostic in the most common case, knowing that this is
# technically a race condition because someone could delete the file between our check here and
# reading the file later on. We expect such cases to be rare.)
try:
with open(self.file_path, 'r'):
pass
except EnvironmentError as error:
raise ValueError("Unable to read the template '{}': {}".format(self.file_path, error))
class ApplicationTemplate(Model):
"""An Azure Batch Application Template.
:param job_manager_task: Details of a Job Manager task to be launched when
the job is started. If the job does not specify a Job Manager task, the
user must explicitly add tasks to the job. If the job does specify a Job
Manager task, the Batch service creates the Job Manager task when the job
is created, and will try to schedule the Job Manager task before
scheduling other tasks in the job. The Job Manager task's typical purpose
is to control and/or monitor job execution, for example by deciding what
additional tasks to run, determining when the work is complete, etc.
(However, a Job Manager task is not restricted to these activities - it is
a fully-fledged task in the system and perform whatever actions are
required for the job.) For example, a Job Manager task might download a
file specified as a parameter, analyze the contents of that file and
submit additional tasks based on those contents.
:type job_manager_task: :class:`JobManagerTask
<azure.batch.models.JobManagerTask>`
:param job_preparation_task: The Job Preparation task. If a job has a Job
Preparation task, the Batch service will run the Job Preparation task on a
compute node before starting any tasks of that job on that compute node.
:type job_preparation_task: :class:`JobPreparationTask
<azure.batch.models.JobPreparationTask>`
:param job_release_task: The Job Release task. A Job Release task cannot
be specified without also specifying a Job Preparation task for the job.
The Batch service runs the Job Release task on the compute nodes that have
run the Job Preparation task. The primary purpose of the Job Release task
is to undo changes to compute nodes made by the Job Preparation task.
Example activities include deleting local files, or shutting down services
that were started as part of job preparation.
:type job_release_task: :class:`JobReleaseTask
<azure.batch.models.JobReleaseTask>`
:param common_environment_settings: The list of common environment
variable settings. These environment variables are set for all tasks in
the job (including the Job Manager, Job Preparation and Job Release
tasks). Individual tasks can override an environment setting specified
here by specifying the same setting name with a different value.
:type common_environment_settings: list of :class:`EnvironmentSetting
<azure.batch.models.EnvironmentSetting>`
:param on_all_tasks_complete: The action the Batch service should take
when all tasks in the job are in the completed state. Note that if a job
contains no tasks, then all tasks are considered complete. This option is
therefore most commonly used with a Job Manager task; if you want to use
automatic job termination without a Job Manager, you should initially set
onAllTasksComplete to noAction and update the job properties to set
onAllTasksComplete to terminateJob once you have finished adding tasks.
Permitted values are: noAction - do nothing. The job remains active unless
terminated or disabled by some other means. terminateJob - terminate the
job. The job's terminateReason is set to 'AllTasksComplete'. The default
is noAction. Possible values include: 'noAction', 'terminateJob'
:type on_all_tasks_complete: str or :class:`OnAllTasksComplete
<azure.batch.models.OnAllTasksComplete>`
:param on_task_failure: The action the Batch service should take when any
task in the job fails. A task is considered to have failed if has a
failureInfo. A failureInfo is set if the task completes with a non-zero
exit code after exhausting its retry count, or if there was an error
starting the task, for example due to a resource file download error.
noAction - do nothing. performExitOptionsJobAction - take the action
associated with the task exit condition in the task's exitConditions
collection. (This may still result in no action being taken, if that is
what the task specifies.) The default is noAction. Possible values
include: 'noAction', 'performExitOptionsJobAction'
:type on_task_failure: str or :class:`OnTaskFailure
<azure.batch.models.OnTaskFailure>`
:param metadata: A list of name-value pairs associated with the job as
metadata. The Batch service does not assign any meaning to metadata; it is
solely for the use of user code.
:type metadata: list of :class:`MetadataItem
<azure.batch.models.MetadataItem>`
:param uses_task_dependencies: Whether tasks in the job can define
dependencies on each other. The default is false.
:type uses_task_dependencies: bool
:param task_factory: A task factory reference to automatically generate a set of
tasks to be added to the job.
:type task_factory: :class:`TaskFactoryBase
<azext.batch.models.TaskFactoryBase>`
"""
_attribute_map = {
'job_manager_task': {'key': 'jobManagerTask', 'type': 'JobManagerTask'},
'job_preparation_task': {'key': 'jobPreparationTask', 'type': 'JobPreparationTask'},
'job_release_task': {'key': 'jobReleaseTask', 'type': 'JobReleaseTask'},
'common_environment_settings': {'key': 'commonEnvironmentSettings', 'type': '[EnvironmentSetting]'},
'on_all_tasks_complete': {'key': 'onAllTasksComplete', 'type': 'OnAllTasksComplete'},
'on_task_failure': {'key': 'onTaskFailure', 'type': 'OnTaskFailure'},
'metadata': {'key': 'metadata', 'type': '[MetadataItem]'},
'uses_task_dependencies': {'key': 'usesTaskDependencies', 'type': 'bool'},
'task_factory': {'key': 'taskFactory', 'type': 'TaskFactoryBase'},
}
def __init__(self, *, job_manager_task=None, job_preparation_task=None, job_release_task=None,
common_environment_settings=None, on_all_tasks_complete=None, on_task_failure=None,
metadata=None, uses_task_dependencies: bool=None, task_factory=None, **kwargs) -> None:
super(ApplicationTemplate, self).__init__(**kwargs)
self.job_manager_task = job_manager_task
self.job_preparation_task = job_preparation_task
self.job_release_task = job_release_task
self.common_environment_settings = common_environment_settings
self.on_all_tasks_complete = on_all_tasks_complete
self.on_task_failure = on_task_failure
self.metadata = metadata
self.uses_task_dependencies = uses_task_dependencies
self.task_factory = task_factory
class AptPackageReference(PackageReferenceBase):
"""A reference to a package to be installed using the APT package
manager on a Linux node (apt-get).
:param str id: The name of the package.
:param str version: The version of the package to be installed. If omitted,
the latest version (according to the package repository) will be installed.
"""
_validation = {
'type': {'required': True},
'id': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
'version': {'key': 'version', 'type': 'str'},
}
def __init__(self, *, id: str, version: str=None, **kwargs) -> None:
super(AptPackageReference, self).__init__(id=id, version=version, **kwargs)
self.type = 'aptPackage'
class AutoPoolSpecification(Model):
"""Specifies characteristics for a temporary 'auto pool'. The Batch service
will create this auto pool when the job is submitted.
:param auto_pool_id_prefix: A prefix to be added to the unique identifier
when a pool is automatically created. The Batch service assigns each auto
pool a unique identifier on creation. To distinguish between pools created
for different purposes, you can specify this element to add a prefix to
the ID that is assigned. The prefix can be up to 20 characters long.
:type auto_pool_id_prefix: str
:param pool_lifetime_option: The minimum lifetime of created auto pools,
and how multiple jobs on a schedule are assigned to pools. When the pool
lifetime is jobSchedule the pool exists for the lifetime of the job
schedule. The Batch Service creates the pool when it creates the first job
on the schedule. You may apply this option only to job schedules, not to
jobs. When the pool lifetime is job the pool exists for the lifetime of
the job to which it is dedicated. The Batch service creates the pool when
it creates the job. If the 'job' option is applied to a job schedule, the
Batch service creates a new auto pool for every job created on the
schedule. Possible values include: 'jobSchedule', 'job'
:type pool_lifetime_option: str or :class:`PoolLifetimeOption
<azure.batch.models.PoolLifetimeOption>`
:param keep_alive: Whether to keep an auto pool alive after its lifetime
expires. If false, the Batch service deletes the pool once its lifetime
(as determined by the poolLifetimeOption setting) expires; that is, when
the job or job schedule completes. If true, the Batch service does not
delete the pool automatically. It is up to the user to delete auto pools
created with this option.
:type keep_alive: bool
:param pool: The pool specification for the auto pool.
:type pool: :class:`PoolSpecification
<azure.batch.models.PoolSpecification>`
"""
_validation = {
'pool_lifetime_option': {'required': True},
}
_attribute_map = {
'auto_pool_id_prefix': {'key': 'autoPoolIdPrefix', 'type': 'str'},
'pool_lifetime_option': {'key': 'poolLifetimeOption', 'type': 'PoolLifetimeOption'},
'keep_alive': {'key': 'keepAlive', 'type': 'bool'},
'pool': {'key': 'pool', 'type': 'ExtendedPoolSpecification'},
}
def __init__(self, *, pool_lifetime_option, auto_pool_id_prefix: str=None,
keep_alive: bool=None, pool=None, **kwargs) -> None:
super(AutoPoolSpecification, self).__init__(**kwargs)
self.auto_pool_id_prefix = auto_pool_id_prefix
self.pool_lifetime_option = pool_lifetime_option
self.keep_alive = keep_alive
self.pool = pool
class ChocolateyPackageReference(PackageReferenceBase):
"""A reference to a package to be installed using the Chocolatey package
manager on a Windows node.
:param str id: The name of the package.
:param str version: The version of the package to be installed. If omitted,
the latest version (according to the package repository) will be installed.
:param bool allow_empty_checksums: Whether Chocolatey will install packages
without a checksum for validation. Default is false.
"""
_validation = {
'type': {'required': True},
'id': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
'version': {'key': 'version', 'type': 'str'},
'allow_empty_checksums': {'key': 'allowEmptyChecksums', 'type': 'bool'}
}
def __init__(self, *, id: str, version: str=None, allow_empty_checksums: bool=None, **kwargs) -> None:
super(ChocolateyPackageReference, self).__init__(id=id, version=version, **kwargs)
self.allow_empty_checksums = allow_empty_checksums
self.type = 'chocolateyPackage'
class ExtendedJobParameter(Model):
"""An Azure Batch job to add.
:param id: A string that uniquely identifies the job within the account.
The ID can contain any combination of alphanumeric characters including
hyphens and underscores, and cannot contain more than 64 characters. The
ID is case-preserving and case-insensitive (that is, you may not have two
IDs within an account that differ only by case).
:type id: str
:param display_name: The display name for the job. The display name need
not be unique and can contain any Unicode characters up to a maximum
length of 1024.
:type display_name: str
:param priority: The priority of the job. Priority values can range from
-1000 to 1000, with -1000 being the lowest priority and 1000 being the
highest priority. The default value is 0.
:type priority: int
:param constraints: The execution constraints for the job.
:type constraints: :class:`JobConstraints
<azure.batch.models.JobConstraints>`
:param job_manager_task: Details of a Job Manager task to be launched when
the job is started. If the job does not specify a Job Manager task, the
user must explicitly add tasks to the job. If the job does specify a Job
Manager task, the Batch service creates the Job Manager task when the job
is created, and will try to schedule the Job Manager task before
scheduling other tasks in the job. The Job Manager task's typical purpose
is to control and/or monitor job execution, for example by deciding what
additional tasks to run, determining when the work is complete, etc.
(However, a Job Manager task is not restricted to these activities - it is
a fully-fledged task in the system and perform whatever actions are
required for the job.) For example, a Job Manager task might download a
file specified as a parameter, analyze the contents of that file and
submit additional tasks based on those contents.
:type job_manager_task: :class:`JobManagerTask
<azure.batch.models.JobManagerTask>`
:param job_preparation_task: The Job Preparation task. If a job has a Job
Preparation task, the Batch service will run the Job Preparation task on a
compute node before starting any tasks of that job on that compute node.
:type job_preparation_task: :class:`JobPreparationTask
<azure.batch.models.JobPreparationTask>`
:param job_release_task: The Job Release task. A Job Release task cannot
be specified without also specifying a Job Preparation task for the job.
The Batch service runs the Job Release task on the compute nodes that have
run the Job Preparation task. The primary purpose of the Job Release task
is to undo changes to compute nodes made by the Job Preparation task.
Example activities include deleting local files, or shutting down services
that were started as part of job preparation.
:type job_release_task: :class:`JobReleaseTask
<azure.batch.models.JobReleaseTask>`
:param common_environment_settings: The list of common environment
variable settings. These environment variables are set for all tasks in
the job (including the Job Manager, Job Preparation and Job Release
tasks). Individual tasks can override an environment setting specified
here by specifying the same setting name with a different value.
:type common_environment_settings: list of :class:`EnvironmentSetting
<azure.batch.models.EnvironmentSetting>`
:param pool_info: The pool on which the Batch service runs the job's
tasks.
:type pool_info: :class:`PoolInformation
<azure.batch.models.PoolInformation>`
:param on_all_tasks_complete: The action the Batch service should take
when all tasks in the job are in the completed state. Note that if a job
contains no tasks, then all tasks are considered complete. This option is
therefore most commonly used with a Job Manager task; if you want to use
automatic job termination without a Job Manager, you should initially set
onAllTasksComplete to noAction and update the job properties to set
onAllTasksComplete to terminateJob once you have finished adding tasks.
Permitted values are: noAction - do nothing. The job remains active unless
terminated or disabled by some other means. terminateJob - terminate the
job. The job's terminateReason is set to 'AllTasksComplete'. The default
is noAction. Possible values include: 'noAction', 'terminateJob'
:type on_all_tasks_complete: str or :class:`OnAllTasksComplete
<azure.batch.models.OnAllTasksComplete>`
:param on_task_failure: The action the Batch service should take when any
task in the job fails. A task is considered to have failed if has a
failureInfo. A failureInfo is set if the task completes with a non-zero
exit code after exhausting its retry count, or if there was an error
starting the task, for example due to a resource file download error.
noAction - do nothing. performExitOptionsJobAction - take the action
associated with the task exit condition in the task's exitConditions
collection. (This may still result in no action being taken, if that is
what the task specifies.) The default is noAction. Possible values
include: 'noAction', 'performExitOptionsJobAction'
:type on_task_failure: str or :class:`OnTaskFailure
<azure.batch.models.OnTaskFailure>`
:param metadata: A list of name-value pairs associated with the job as
metadata. The Batch service does not assign any meaning to metadata; it is
solely for the use of user code.
:type metadata: list of :class:`MetadataItem
<azure.batch.models.MetadataItem>`
:param uses_task_dependencies: Whether tasks in the job can define
dependencies on each other. The default is false.
:type uses_task_dependencies: bool
:param task_factory: A task factory reference to automatically generate a set of
tasks to be added to the job.
:type task_factory: :class:`TaskFactoryBase
<azext.batch.models.TaskFactoryBase>`
:param application_template_info: A reference to an application template file to
be expanded to complete the job specification. If supplied, the following arugments
cannot also be supplied or they will be overwritten: 'job_manager_task',
'common_environment_settings', 'uses_task_dependencies', 'on_all_tasks_complete',
'on_task_failure', 'task_factory', 'job_preparation_task', 'job_release_task'.
:type application_template_info: :class:`ApplicationTemplateInfo
<azext.batch.models.ApplicationTemplateInfo>`
:param base_model: A reference to the object this class should extend
:type base_model: :class:`Model
<msrest.serialization.Model>`
"""
_validation = {
'id': {'required': True},
'pool_info': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'priority': {'key': 'priority', 'type': 'int'},
'constraints': {'key': 'constraints', 'type': 'JobConstraints'},
'job_manager_task': {'key': 'jobManagerTask', 'type': 'JobManagerTask'},
'job_preparation_task': {'key': 'jobPreparationTask', 'type': 'JobPreparationTask'},
'job_release_task': {'key': 'jobReleaseTask', 'type': 'JobReleaseTask'},
'common_environment_settings': {'key': 'commonEnvironmentSettings', 'type': '[EnvironmentSetting]'},
'pool_info': {'key': 'poolInfo', 'type': 'PoolInformation'},
'on_all_tasks_complete': {'key': 'onAllTasksComplete', 'type': 'OnAllTasksComplete'},
'on_task_failure': {'key': 'onTaskFailure', 'type': 'OnTaskFailure'},
'metadata': {'key': 'metadata', 'type': '[MetadataItem]'},
'uses_task_dependencies': {'key': 'usesTaskDependencies', 'type': 'bool'},
'task_factory': {'key': 'taskFactory', 'type': 'TaskFactoryBase'},
'application_template_info': {'key': 'applicationTemplateInfo', 'type': 'ApplicationTemplateInfo'},
'base_model': {'key': 'baseModel', 'type': 'Model'}
}
def __init__(self, *, id: str, pool_info, display_name: str=None, priority: int=None, constraints=None,
job_manager_task=None, job_preparation_task=None, job_release_task=None,
common_environment_settings=None, on_all_tasks_complete=None, on_task_failure=None,
metadata=None, uses_task_dependencies: bool=None, task_factory=None,
application_template_info=None, base_model=JobAddParameter, **kwargs) -> None:
base_model.__init__(
self,
id=id,
display_name=display_name,
priority=priority,
constraints=constraints,
job_manager_task=job_manager_task,
job_preparation_task=job_preparation_task,
job_release_task=job_release_task,
common_environment_settings=common_environment_settings,
pool_info=pool_info,
on_all_tasks_complete=on_all_tasks_complete,
on_task_failure=on_task_failure,
metadata=metadata,
uses_task_dependencies=uses_task_dependencies,
**kwargs)
self.task_factory = task_factory
self.application_template_info = application_template_info
if self.application_template_info:
# Rule: Jobs may not use properties reserved for template use
reserved = [k for k, v in self.__dict__.items() \
if k in ATTRS_RESERVED_FOR_TEMPLATES and v is not None]
if reserved:
raise ValueError("Jobs using application templates may not use these "
"properties: {}".format(', '.join(reserved)))
class ExtendedOutputFileDestination(Model):
"""The specification for where output files should be uploaded to on task
completion.
:param container: A location in Azure blob storage to which files are
uploaded. This cannot be combined with auto_storage.
:type container: :class:`OutputFileBlobContainerDestination
<azure.batch.models.OutputFileBlobContainerDestination>`
:param auto_storage: An auto-storage file group reference. This cannot be
combined with container.
:type auto_storage: :class:`OutputFileAutoStorageDestination
<azext.batch.models.OutputFileAutoStorageDestination>`
:param base_model: A reference to the object this class should extend
:type base_model: :class:`Model
<msrest.serialization.Model>`
"""
_attribute_map = {
'container': {'key': 'container', 'type': 'OutputFileBlobContainerDestination'},
'auto_storage': {'key': 'autoStorage', 'type': 'OutputFileAutoStorageDestination'},
'base_model': {'key': 'baseModel', 'type': 'Model'}
}
def __init__(self, *, container=None, auto_storage=None, **kwargs) -> None:
super(ExtendedOutputFileDestination, self).__init__(**kwargs)
if container and auto_storage:
raise ValueError("Cannot specify both container and auto_storage.")
self.container = container
self.auto_storage = auto_storage
class ExtendedPoolParameter(Model):
"""A pool in the Azure Batch service to add.
:param id: Required. A string that uniquely identifies the Pool within the
Account. The ID can contain any combination of alphanumeric characters
including hyphens and underscores, and cannot contain more than 64
characters. The ID is case-preserving and case-insensitive (that is, you
may not have two Pool IDs within an Account that differ only by case).
:type id: str
:param display_name: The display name for the Pool. The display name need
not be unique and can contain any Unicode characters up to a maximum
length of 1024.
:type display_name: str
:param vm_size: Required. The size of virtual machines in the Pool. All
virtual machines in a Pool are the same size. For information about
available sizes of virtual machines for Cloud Services Pools (pools
created with cloudServiceConfiguration), see Sizes for Cloud Services
(https://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/).
Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and
A2V2. For information about available VM sizes for Pools using Images from
the Virtual Machines Marketplace (pools created with
virtualMachineConfiguration) see Sizes for Virtual Machines (Linux)
(https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/)
or Sizes for Virtual Machines (Windows)
(https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/).
Batch supports all Azure VM sizes except STANDARD_A0 and those with
premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
:type vm_size: str
:param cloud_service_configuration: The cloud service configuration for
the Pool. This property and virtualMachineConfiguration are mutually
exclusive and one of the properties must be specified. This property
cannot be specified if the Batch Account was created with its
poolAllocationMode property set to 'UserSubscription'.
:type cloud_service_configuration:
~azure.batch.models.CloudServiceConfiguration
:param virtual_machine_configuration: The virtual machine configuration
for the Pool. This property and cloudServiceConfiguration are mutually
exclusive and one of the properties must be specified.
:type virtual_machine_configuration:
~azure.batch.models.VirtualMachineConfiguration
:param resize_timeout: The timeout for allocation of Compute Nodes to the
Pool. This timeout applies only to manual scaling; it has no effect when
enableAutoScale is set to true. The default value is 15 minutes. The
minimum value is 5 minutes. If you specify a value less than 5 minutes,
the Batch service returns an error; if you are calling the REST API
directly, the HTTP status code is 400 (Bad Request).
:type resize_timeout: timedelta
:param target_dedicated_nodes: The desired number of dedicated Compute
Nodes in the Pool. This property must not be specified if enableAutoScale
is set to true. If enableAutoScale is set to false, then you must set
either targetDedicatedNodes, targetLowPriorityNodes, or both.
:type target_dedicated_nodes: int
:param target_low_priority_nodes: The desired number of low-priority
Compute Nodes in the Pool. This property must not be specified if
enableAutoScale is set to true. If enableAutoScale is set to false, then
you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
:type target_low_priority_nodes: int
:param enable_auto_scale: Whether the Pool size should automatically
adjust over time. If false, at least one of targetDedicateNodes and
targetLowPriorityNodes must be specified. If true, the autoScaleFormula
property is required and the Pool automatically resizes according to the
formula. The default value is false.
:type enable_auto_scale: bool
:param auto_scale_formula: A formula for the desired number of Compute
Nodes in the Pool. This property must not be specified if enableAutoScale
is set to false. It is required if enableAutoScale is set to true. The
formula is checked for validity before the Pool is created. If the formula
is not valid, the Batch service rejects the request with detailed error
information. For more information about specifying this formula, see
'Automatically scale Compute Nodes in an Azure Batch Pool'
(https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/).
:type auto_scale_formula: str
:param auto_scale_evaluation_interval: The time interval at which to
automatically adjust the Pool size according to the autoscale formula. The
default value is 15 minutes. The minimum and maximum value are 5 minutes
and 168 hours respectively. If you specify a value less than 5 minutes or
greater than 168 hours, the Batch service returns an error; if you are
calling the REST API directly, the HTTP status code is 400 (Bad Request).
:type auto_scale_evaluation_interval: timedelta
:param enable_inter_node_communication: Whether the Pool permits direct
communication between Compute Nodes. Enabling inter-node communication
limits the maximum size of the Pool due to deployment restrictions on the
Compute Nodes of the Pool. This may result in the Pool not reaching its
desired size. The default value is false.
:type enable_inter_node_communication: bool
:param network_configuration: The network configuration for the Pool.
:type network_configuration: ~azure.batch.models.NetworkConfiguration
:param start_task: A Task specified to run on each Compute Node as it
joins the Pool. The Task runs when the Compute Node is added to the Pool
or when the Compute Node is restarted.
:type start_task: ~azure.batch.models.StartTask
:param certificate_references: The list of Certificates to be installed on
each Compute Node in the Pool. For Windows Nodes, the Batch service
installs the Certificates to the specified Certificate store and location.
For Linux Compute Nodes, the Certificates are stored in a directory inside
the Task working directory and an environment variable
AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this
location. For Certificates with visibility of 'remoteUser', a 'certs'
directory is created in the user's home directory (e.g.,
/home/{user-name}/certs) and Certificates are placed in that directory.
:type certificate_references:
list[~azure.batch.models.CertificateReference]
:param application_package_references: The list of Packages to be
installed on each Compute Node in the Pool. Changes to Package references
affect all new Nodes joining the Pool, but do not affect Compute Nodes
that are already in the Pool until they are rebooted or reimaged. There is
a maximum of 10 Package references on any given Pool.
:type application_package_references:
list[~azure.batch.models.ApplicationPackageReference]
:param application_licenses: The list of application licenses the Batch
service will make available on each Compute Node in the Pool. The list of
application licenses must be a subset of available Batch service
application licenses. If a license is requested which is not supported,
Pool creation will fail.
:type application_licenses: list[str]
:param max_tasks_per_node: The maximum number of Tasks that can run
concurrently on a single Compute Node in the Pool. The default value is 1.
The maximum value is the smaller of 4 times the number of cores of the
vmSize of the Pool or 256.
:type max_tasks_per_node: int
:param task_scheduling_policy: How Tasks are distributed across Compute
Nodes in a Pool. If not specified, the default is spread.
:type task_scheduling_policy: ~azure.batch.models.TaskSchedulingPolicy
:param user_accounts: The list of user Accounts to be created on each
Compute Node in the Pool.
:type user_accounts: list[~azure.batch.models.UserAccount]
:param metadata: A list of name-value pairs associated with the Pool as
metadata. The Batch service does not assign any meaning to metadata; it is
solely for the use of user code.
:type metadata: list[~azure.batch.models.MetadataItem]
:param mount_configuration: Mount storage using specified file system for
the entire lifetime of the pool. Mount the storage using Azure fileshare,
NFS, CIFS or Blobfuse based file system.
:type mount_configuration: list[~azure.batch.models.MountConfiguration]
:param package_references: A list of packages to be installed on the compute
nodes. Must be of a Package Manager type in accordance with the selected
operating system.
:type package_references: list of :class:`PackageReferenceBase
<azext.batch.models.PackageReferenceBase>`
:param base_model: A reference to the object this class should extend
:type base_model: :class:`Model
<msrest.serialization.Model>`
"""
_validation = {
'id': {'required': True},
'vm_size': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'vm_size': {'key': 'vmSize', 'type': 'str'},
'cloud_service_configuration': {'key': 'cloudServiceConfiguration', 'type': 'CloudServiceConfiguration'},
'virtual_machine_configuration': {'key': 'virtualMachineConfiguration', 'type': 'VirtualMachineConfiguration'},
'resize_timeout': {'key': 'resizeTimeout', 'type': 'duration'},
'target_dedicated_nodes': {'key': 'targetDedicatedNodes', 'type': 'int'},
'target_low_priority_nodes': {'key': 'targetLowPriorityNodes', 'type': 'int'},
'enable_auto_scale': {'key': 'enableAutoScale', 'type': 'bool'},
'auto_scale_formula': {'key': 'autoScaleFormula', 'type': 'str'},
'auto_scale_evaluation_interval': {'key': 'autoScaleEvaluationInterval', 'type': 'duration'},
'enable_inter_node_communication': {'key': 'enableInterNodeCommunication', 'type': 'bool'},
'network_configuration': {'key': 'networkConfiguration', 'type': 'NetworkConfiguration'},
'start_task': {'key': 'startTask', 'type': 'StartTask'},
'certificate_references': {'key': 'certificateReferences', 'type': '[CertificateReference]'},
'application_package_references': {'key': 'applicationPackageReferences', 'type': '[ApplicationPackageReference]'},
'application_licenses': {'key': 'applicationLicenses', 'type': '[str]'},
'max_tasks_per_node': {'key': 'maxTasksPerNode', 'type': 'int'},
'task_scheduling_policy': {'key': 'taskSchedulingPolicy', 'type': 'TaskSchedulingPolicy'},
'user_accounts': {'key': 'userAccounts', 'type': '[UserAccount]'},
'metadata': {'key': 'metadata', 'type': '[MetadataItem]'},
'mount_configuration': {'key': 'mountConfiguration', 'type': '[MountConfiguration]'},
'package_references': {'key': 'packageReferences', 'type': '[PackageReferenceBase]'},
'base_model': {'key': 'baseModel', 'type': 'Model'}
}
def __init__(self, *, id: str, vm_size: str, display_name: str=None, cloud_service_configuration=None,
virtual_machine_configuration=None, resize_timeout=None, target_dedicated_nodes: int=None,
target_low_priority_nodes: int=None, enable_auto_scale: bool=None, auto_scale_formula: str=None,
auto_scale_evaluation_interval=None, enable_inter_node_communication: bool=None, network_configuration=None,
start_task=None, certificate_references=None, application_package_references=None, application_licenses=None,
max_tasks_per_node: int=None, task_scheduling_policy=None, user_accounts=None, metadata=None,
mount_configuration=None, package_references=None, base_model=PoolAddParameter,
**kwargs) -> None:
base_model.__init__(
self,
id=id,
display_name=display_name,
vm_size=vm_size,
cloud_service_configuration=cloud_service_configuration,
virtual_machine_configuration=virtual_machine_configuration,
resize_timeout=resize_timeout,
target_dedicated_nodes=target_dedicated_nodes,
target_low_priority_nodes=target_low_priority_nodes,
enable_auto_scale=enable_auto_scale,
auto_scale_formula=auto_scale_formula,
auto_scale_evaluation_interval=auto_scale_evaluation_interval,
enable_inter_node_communication=enable_inter_node_communication,
network_configuration=network_configuration,
start_task=start_task,
certificate_references=certificate_references,
application_package_references=application_package_references,
application_licenses=application_licenses,
max_tasks_per_node=max_tasks_per_node,
task_scheduling_policy=task_scheduling_policy,
user_accounts=user_accounts,
metadata=metadata,
mount_configuration=mount_configuration,
**kwargs)
self.package_references = package_references
class ExtendedPoolSpecification(Model):
"""Specification for creating a new pool.
:param display_name: The display name for the pool. The display name need
not be unique and can contain any Unicode characters up to a maximum
length of 1024.
:type display_name: str
:param vm_size: The size of the virtual machines in the pool. All virtual
machines in a pool are the same size. For information about available
sizes of virtual machines for Cloud Services pools (pools created with
cloudServiceConfiguration), see Sizes for Cloud Services
(http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/).
Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and
A2V2. For information about available VM sizes for pools using images from
the Virtual Machines Marketplace (pools created with
virtualMachineConfiguration) see Sizes for Virtual Machines (Linux)
(https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/)
or Sizes for Virtual Machines (Windows)
(https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/).
Batch supports all Azure VM sizes except STANDARD_A0 and those with
premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
:type vm_size: str
:param cloud_service_configuration: The cloud service configuration for
the pool. This property must be specified if the pool needs to be created
with Azure PaaS VMs. This property and virtualMachineConfiguration are
mutually exclusive and one of the properties must be specified. If neither
is specified then the Batch service returns an error; if you are calling
the REST API directly, the HTTP status code is 400 (Bad Request). This
property cannot be specified if the Batch account was created with its
poolAllocationMode property set to 'UserSubscription'.
:type cloud_service_configuration: :class:`CloudServiceConfiguration
<azure.batch.models.CloudServiceConfiguration>`
:param virtual_machine_configuration: The virtual machine configuration
for the pool. This property must be specified if the pool needs to be
created with Azure IaaS VMs. This property and cloudServiceConfiguration
are mutually exclusive and one of the properties must be specified. If
neither is specified then the Batch service returns an error; if you are
calling the REST API directly, the HTTP status code is 400 (Bad Request).
:type virtual_machine_configuration: :class:`VirtualMachineConfiguration
<azure.batch.models.VirtualMachineConfiguration>`
:param max_tasks_per_node: The maximum number of tasks that can run
concurrently on a single compute node in the pool. The default value is 1.
The maximum value of this setting depends on the size of the compute nodes
in the pool (the vmSize setting).
:type max_tasks_per_node: int
:param task_scheduling_policy: How tasks are distributed across compute
nodes in a pool.
:type task_scheduling_policy: :class:`TaskSchedulingPolicy
<azure.batch.models.TaskSchedulingPolicy>`
:param resize_timeout: The timeout for allocation of compute nodes to the
pool. This timeout applies only to manual scaling; it has no effect when
enableAutoScale is set to true. The default value is 15 minutes. The
minimum value is 5 minutes. If you specify a value less than 5 minutes,
the Batch service rejects the request with an error; if you are calling
the REST API directly, the HTTP status code is 400 (Bad Request).
:type resize_timeout: timedelta
:param target_dedicated_nodes: The desired number of dedicated compute
nodes in the pool. This property must not be specified if enableAutoScale
is set to true. If enableAutoScale is set to false, then you must set
either targetDedicatedNodes, targetLowPriorityNodes, or both.
:type target_dedicated_nodes: int
:param target_low_priority_nodes: The desired number of low-priority
compute nodes in the pool. This property must not be specified if
enableAutoScale is set to true. If enableAutoScale is set to false, then
you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
:type target_low_priority_nodes: int
:param enable_auto_scale: Whether the pool size should automatically
adjust over time. If false, the targetDedicated element is required. If
true, the autoScaleFormula element is required. The pool automatically
resizes according to the formula. The default value is false.
:type enable_auto_scale: bool
:param auto_scale_formula: The formula for the desired number of compute
nodes in the pool. This property must not be specified if enableAutoScale
is set to false. It is required if enableAutoScale is set to true. The
formula is checked for validity before the pool is created. If the formula
is not valid, the Batch service rejects the request with detailed error
information.
:type auto_scale_formula: str
:param auto_scale_evaluation_interval: The time interval at which to
automatically adjust the pool size according to the autoscale formula. The
default value is 15 minutes. The minimum and maximum value are 5 minutes
and 168 hours respectively. If you specify a value less than 5 minutes or
greater than 168 hours, the Batch service rejects the request with an
invalid property value error; if you are calling the REST API directly,
the HTTP status code is 400 (Bad Request).
:type auto_scale_evaluation_interval: timedelta
:param enable_inter_node_communication: Whether the pool permits direct
communication between nodes. Enabling inter-node communication limits the
maximum size of the pool due to deployment restrictions on the nodes of
the pool. This may result in the pool not reaching its desired size. The
default value is false.
:type enable_inter_node_communication: bool
:param network_configuration: The network configuration for the pool.
:type network_configuration: :class:`NetworkConfiguration
<azure.batch.models.NetworkConfiguration>`
:param start_task: A task to run on each compute node as it joins the
pool. The task runs when the node is added to the pool or when the node is
restarted.
:type start_task: :class:`StartTask <azure.batch.models.StartTask>`
:param certificate_references: A list of certificates to be installed on
each compute node in the pool. For Windows compute nodes, the Batch
service installs the certificates to the specified certificate store and
location. For Linux compute nodes, the certificates are stored in a
directory inside the task working directory and an environment variable
AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this
location. For certificates with visibility of 'remoteUser', a 'certs'
directory is created in the user's home directory (e.g.,
/home/{user-name}/certs) and certificates are placed in that directory.
:type certificate_references: list of :class:`CertificateReference
<azure.batch.models.CertificateReference>`
:param application_package_references: The list of application packages to
be installed on each compute node in the pool.
:type application_package_references: list of
:class:`ApplicationPackageReference
<azure.batch.models.ApplicationPackageReference>`
:param application_licenses: The list of application licenses the Batch
service will make available on each compute node in the pool. The list of
application licenses must be a subset of available Batch service
application licenses. If a license is requested which is not supported,
pool creation will fail.
:type application_licenses: list of str
:param user_accounts: The list of user accounts to be created on each node
in the pool.
:type user_accounts: list of :class:`UserAccount
<azure.batch.models.UserAccount>`
:param metadata: A list of name-value pairs associated with the pool as
metadata. The Batch service does not assign any meaning to metadata; it is
solely for the use of user code.
:type metadata: list of :class:`MetadataItem
<azure.batch.models.MetadataItem>`
:param package_references: A list of packages to be installed on the compute
nodes. Must be of a Package Manager type in accordance with the selected
operating system.
:type package_references: list of :class:`PackageReferenceBase
<azext.batch.models.PackageReferenceBase>`
:param base_model: A reference to the object this class should extend
:type base_model: :class:`Model
<msrest.serialization.Model>`
"""
_validation = {
'vm_size': {'required': True},
}
_attribute_map = {
'display_name': {'key': 'displayName', 'type': 'str'},
'vm_size': {'key': 'vmSize', 'type': 'str'},
'cloud_service_configuration': {'key': 'cloudServiceConfiguration',
'type': 'CloudServiceConfiguration'},
'virtual_machine_configuration': {'key': 'virtualMachineConfiguration',
'type': 'VirtualMachineConfiguration'},
'max_tasks_per_node': {'key': 'maxTasksPerNode', 'type': 'int'},
'task_scheduling_policy': {'key': 'taskSchedulingPolicy', 'type': 'TaskSchedulingPolicy'},
'resize_timeout': {'key': 'resizeTimeout', 'type': 'duration'},
'target_dedicated_nodes': {'key': 'targetDedicatedNodes', 'type': 'int'},
'target_low_priority_nodes': {'key': 'targetLowPriorityNodes', 'type': 'int'},
'enable_auto_scale': {'key': 'enableAutoScale', 'type': 'bool'},
'auto_scale_formula': {'key': 'autoScaleFormula', 'type': 'str'},
'auto_scale_evaluation_interval': {'key': 'autoScaleEvaluationInterval', 'type': 'duration'},
'enable_inter_node_communication': {'key': 'enableInterNodeCommunication', 'type': 'bool'},
'network_configuration': {'key': 'networkConfiguration', 'type': 'NetworkConfiguration'},
'start_task': {'key': 'startTask', 'type': 'StartTask'},
'certificate_references': {'key': 'certificateReferences', 'type': '[CertificateReference]'},
'application_package_references': {'key': 'applicationPackageReferences',
'type': '[ApplicationPackageReference]'},
'application_licenses': {'key': 'applicationLicenses', 'type': '[str]'},
'user_accounts': {'key': 'userAccounts', 'type': '[UserAccount]'},
'metadata': {'key': 'metadata', 'type': '[MetadataItem]'},
'package_references': {'key': 'packageReferences', 'type': '[PackageReferenceBase]'},
'base_model': {'key': 'baseModel', 'type': 'Model'}
}
def __init__(self, *, vm_size: str, display_name: str=None, cloud_service_configuration=None,
virtual_machine_configuration=None, max_tasks_per_node: int=None, task_scheduling_policy=None,
resize_timeout=None, target_dedicated_nodes: int=None, target_low_priority_nodes: int=None,
enable_auto_scale: bool=None, auto_scale_formula: str=None, auto_scale_evaluation_interval=None,
enable_inter_node_communication: bool=None, network_configuration=None, start_task=None,
certificate_references=None, application_package_references=None, application_licenses=None,
user_accounts=None, metadata=None, package_references=None, base_model=PoolSpecification,
**kwargs) -> None:
base_model.__init__(
self,
display_name=display_name,
vm_size=vm_size,
cloud_service_configuration=cloud_service_configuration,
virtual_machine_configuration=virtual_machine_configuration,
max_tasks_per_node=max_tasks_per_node,
task_scheduling_policy=task_scheduling_policy,
resize_timeout=resize_timeout,
target_dedicated_nodes=target_dedicated_nodes,
target_low_priority_nodes=target_low_priority_nodes,
enable_auto_scale=enable_auto_scale,
auto_scale_formula=auto_scale_formula,
auto_scale_evaluation_interval=auto_scale_evaluation_interval,
enable_inter_node_communication=enable_inter_node_communication,
network_configuration=network_configuration,
start_task=start_task,
certificate_references=certificate_references,
application_package_references=application_package_references,
application_licenses=application_licenses,
user_accounts=user_accounts,
metadata=metadata,
**kwargs)
self.package_references = package_references
class ExtendedResourceFile(Model):
"""A file to be downloaded from Azure blob storage to a compute node.
:param http_url: The URL of the file within Azure Blob Storage. This
URL must be readable using anonymous access; that is, the Batch service
does not present any credentials when downloading the blob. There are two
ways to get such a URL for a blob in Azure storage: include a Shared
Access Signature (SAS) granting read permissions on the blob, or set the
ACL for the blob or its container to allow public access.
:type http_url: str
:param auto_storage_container_name: 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.
:type auto_storage_container_name: str
:param storage_container_url: 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 using anonymous access; that is, the
Batch service does not present any credentials when downloading blobs from
the container. There are two 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, or set the ACL for the container to
allow public access.
:type storage_container_url: str
:param blob_prefix: 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.
:type blob_prefix: str
:param file_path: The location on the compute node to which to download
the file, relative to the task's working directory. If using a file group
source that references more than one file, this will be considered the name
of a directory, otherwise it will be treated as the destination file name.
:type file_path: str
:param file_mode: 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 node. If this property is not specified for a
Linux node, then a default value of 0770 is applied to the file.
If using a file group source that references more than one file, this will be
applied to all files in the group.
:type file_mode: str
:param source: A file source reference which could include a collection of files from
a Azure Storage container or an auto-storage file group.
:type source: :class:`FileSource
<azext.batch.models.FileSource>`
:param base_model: A reference to the object this class should extend
:type base_model: :class:`Model