Change the fileGroup to under 'autoStorage' property.

This commit is contained in:
xingwu1 2017-03-09 11:01:13 -08:00
Родитель a95f81105c
Коммит d5978c5ea5
5 изменённых файлов: 30 добавлений и 22 удалений

Просмотреть файл

@ -51,9 +51,10 @@ otherwise the error logs are uploaded for debugging.
### destination
| Property | Required | Type | Description |
| --------- | --------- | ------------ | ------------------------------------ |
| container | Mandatory | Complex Type | Details of the destination container |
| Property | Required | Type | Description |
| ----------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------- |
| container | Optional | Complex Type | Details of the destination container. The `container` property is mutually exclusive with `autoStorage` property. |
| autoStorage | OPtional | Complex Type | Details of the destination under auto-storage. The `autoStorage` property is mutually exclusive with `container` property. |
### container
@ -61,7 +62,13 @@ otherwise the error logs are uploaded for debugging.
| ------------ | --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| path | Optional | String | Path within the container to which data will be uploaded. If `filePath` refers to multiple files, `path` will be considered a virtual directory within the container. Otherwise `path` will be considered to include the filename used in storage. |
| containerSas | Optional | String | The SAS URL to the storage container used to hold the output data. The SAS must have write permissions. <br/> Note: A SAS URL to your entire storage account will not work, nor will one that has expired. |
| fileGroup | Optional | String | The file group stored in linked storage. <br> The 'fileGroup' property is mutually exclusive with 'containerSas' property. |
### autoStorage
| Property | Required | Type | Description |
| ------------ | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| path | Optional | String | Path within the file group to which data will be uploaded. If `filePath` refers to multiple files, `path` will be considered a virtual directory within the file group. Otherwise `path` will be considered to include the filename used in storage. |
| fileGroup | Optional | String | The file group stored in linked storage. |
### uploadDetails

Просмотреть файл

@ -86,7 +86,7 @@
{
"filePattern": "$AZ_BATCH_TASK_DIR/stdout.txt",
"destination": {
"container": {
"autoStorage": {
"path": "output-{fileName}",
"fileGroup": "[parameters('outputData')]"
}

Просмотреть файл

@ -706,19 +706,20 @@ def _parse_task_output_files(task, os_flavor, file_utils):
for prop in ['filePattern', 'destination', 'uploadDetails']:
if prop not in output_file:
raise ValueError("outputFile must include '{}'".format(prop))
if 'container' not in output_file['destination']:
raise ValueError("outputFile must include 'container' property.")
if 'fileGroup' in output_file['destination']['container']:
if 'containerSas' in output_file['destination']['container']:
raise ValueError("'container' of 'outputFile' can only have only one of "
"'containerSas' and 'fileGroup' properties.")
else:
file_group = output_file['destination']['container'].pop('fileGroup')
output_file['destination']['container']['containerSas'] = \
file_utils.get_container_sas(file_group)
if 'containerSas' not in output_file['destination']['container']:
raise ValueError("'container' of 'outputFile' must has with "
"'containerSas' or 'fileGroup' property.")
destination = output_file['destination']
if 'container' not in destination and 'autoStorage' not in destination:
raise ValueError("outputFile must include 'container' or 'autoStorage' property.")
if 'container' in destination and 'autoStorage' in destination:
raise ValueError("outputFile can not have both 'container' "
"and 'autoStorage' properties.")
if 'autoStorage' in destination:
if 'fileGroup' not in destination['autoStorage']:
raise ValueError("'autoStorage' of 'destination' must have 'fileGroup' property.")
destination['container'] = {'containerSas': \
file_utils.get_container_sas(destination['autoStorage']['fileGroup'])}
if 'path' in destination['autoStorage']:
destination['container']['path'] = destination['autoStorage']['path']
destination.pop('autoStorage')
if not output_file['uploadDetails'].get('taskStatus'):
raise ValueError("outputFile.uploadDetails must include taskStatus.")
# Edit the command line to run the upload

Просмотреть файл

@ -234,7 +234,7 @@ class TestBatchNCJLive(VCRTestBase):
{
'filePattern': '$AZ_BATCH_TASK_DIR/*.txt',
'destination': {
'container': {
'autoStorage': {
'fileGroup': 'output'
}
},

Просмотреть файл

@ -1288,7 +1288,7 @@ class TestBatchNCJTemplates(unittest.TestCase):
outputFiles = [{
'filePattern': '*.txt',
'destination': {
'container': {
'autoStorage': {
'fileGroup': 'output'
}
},
@ -1318,7 +1318,7 @@ class TestBatchNCJTemplates(unittest.TestCase):
outputFiles = [{
'filePattern': '*.txt',
'destination': {
'container': {
'autoStorage': {
'fileGroup': 'output'
}
},
@ -1355,7 +1355,7 @@ class TestBatchNCJTemplates(unittest.TestCase):
outputFiles = [{
'filePattern': '*.txt',
'destination': {
'container': {
'autoStorage': {
'fileGroup': 'output'
}
},