4.23
Modify Template History
This topic provides information on how to modify the application template's history/version number (api/templates/<history_pk>/history/<version>). See 4.22 Modify Template for information on how to modify the application template itself (api/templates/<id>).
The are two different methods that you can use to modify an application template history/version number:
- PUT – Creates a copy of the selected application template history version and applies it as the current version for the application template (reverts the application template to a previous version's information).
- PATCH – Lets you modify the version description for the selected application template history version, all other attributes, including the template version, remain unchanged.
In this topic:
In this section:
PUT /api/templates/<history_pk>/history/<version>/
| Parameter | Required | Type | Description | Example |
|---|---|---|---|---|
| history_pk | Yes | String | History ID of the application template | b00ce08c-01ed-4a9d-a916-f587b9f1af44 |
| version | Yes | Integer | Version of the application template | 2 |
This section provides an example of how to take an older application template's version and copy and save it as a new (current) version.
PUT /api/templates/b00ce08c-01ed-4a9d-a916-f587b9f1af44/history/1/
{ "url": "http://localhost:8080/api/templates/5/",
"history_url": "http://localhost:8080/api/templates/b00ce08c-01ed-4a9d-a916-f587b9f1af44/history/",
"changed_by": "moab-admin",
"current": true,
"date": "2016-09-08T12:14:19.647410Z",
"id": 5,
"name": "Free Form v.2",
"type": "regular",
"description": {
"text": "<h1><strong>Welcome
to our Free Form</strong> Application
Template!</h1>\n\n<p>Fill in the inputs and press the
"Create" button to submit your
job!</p>\n\n<p>-- Enjoy!</p>",
"visible": true
},
"owner": "moab-admin",
"permissions": [
{
"name": "ALL",
"type": "account"
},
{
"name": "ALL",
"type": "group"
},
{
"name": "ALL",
"type": "user"
}
],
"published": true,
"sections": [
{
"name": "description",
"value": "Application Description"
},
{
"name": "advanced",
"value": "Advanced Settings"
},
{
"name": "basic",
"value": "Basic Settings"
},
{
"name": "custom",
"value": "Custom Settings"
},
{
"name": "dataManagement",
"value": "Data Management"
},
{
"name": "resources",
"value": "Resources"
},
{
"name": "credentials",
"value": "Credentials"
},
{
"name": "timeManagement",
"value": "Time Management"
},
{
"name": "defaults",
"value": "Basic Job Settings"
}
],
"use": 0,
"widgets": [
{
"default_value": "ggg",
"editable": true,
"label": "Name",
"variable_name": "NAME",
"visible": true,
"properties": [
{
"name": "id",
"value": "name"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "0",
"editable": true,
"label": "Duration",
"variable_name": "DURATION",
"visible": true,
"properties": [
{
"name": "id",
"value": "duration"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Job Arrays",
"variable_name": "arrays",
"visible": false,
"properties": [
{
"name": "id",
"value": "arrays"
},
{
"name": "enable",
"value": "false"
},
{
"name": "start-value",
"value": "0"
},
{
"name": "end-value",
"value": "1"
},
{
"name": "start-variable",
"value": "STARTINDEX"
},
{
"name": "end-variable",
"value": "ENDINDEX"
}
]
},
{
"default_value": "0",
"editable": true,
"label": "Delay Start By",
"variable_name": "ELIGIBLEDATE",
"visible": true,
"properties": [
{
"name": "id",
"value": "eligibledate"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "0",
"editable": false,
"label": "User Priority",
"variable_name": "USERPRIORITY",
"visible": false,
"properties": [
{
"name": "id",
"value": "priority"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Submission Script",
"variable_name": "SCRIPT",
"visible": true,
"properties": [
{
"name": "id",
"value": "script"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Account",
"variable_name": "ACCOUNT",
"visible": true,
"properties": [
{
"name": "id",
"value": "account"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Queue / Class",
"variable_name": "DESTINATIONQUEUE",
"visible": true,
"properties": [
{
"name": "id",
"value": "destinationQueue"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Quality of Service",
"variable_name": "QOS",
"visible": true,
"properties": [
{
"name": "id",
"value": "qos"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Number of Cores",
"variable_name": "NUMOFCORES",
"visible": true,
"properties": [
{
"name": "id",
"value": "cpupernode"
},
{
"name": "totalamount",
"value": "True"
},
{
"name": "nodeswithcount",
"value": "True"
},
{
"name": "malleablecorecount",
"value": "False"
},
{
"name": "totalamount_editable",
"value": "False"
},
{
"name": "nodeswithcount_editable",
"value": "False"
},
{
"name": "malleablecorecount_editable",
"value": "False"
},
{
"name": "totalamount_visible_default",
"value": "True"
},
{
"name": "nodeswithcount_visible_default",
"value": "False"
},
{
"name": "malleablecorecount_visible_default",
"value": "False"
},
{
"name": "totalcores_default",
"value": "1"
},
{
"name": "totalnodes_default",
"value": "1"
},
{
"name": "corespernode_default",
"value": "1"
},
{
"name": "minimumcores_default",
"value": "1"
},
{
"name": "maximumcores_default",
"value": "2"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Total Memory (GB)",
"variable_name": "MEMORYAMOUNT",
"visible": true,
"properties": [
{
"name": "id",
"value": "memorypernode"
},
{
"name": "totalmemory",
"value": "True"
},
{
"name": "memorypercore",
"value": "True"
},
{
"name": "totalmemory_visible_default",
"value": "True"
},
{
"name": "memorypercore_visible_default",
"value": "True"
},
{
"name": "totalmemory_default",
"value": "0.5"
},
{
"name": "memorypercore_default",
"value": "0.5"
},
{
"name": "totalmemory_editable",
"value": "False"
},
{
"name": "memorypercore_editable",
"value": "False"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "linux",
"editable": true,
"label": "Architecture",
"variable_name": "ARCHITECTURE",
"visible": true,
"properties": [
{
"name": "id",
"value": "architecture"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Execution Path",
"variable_name": "EXECUTIONDIRECTORY",
"visible": true,
"properties": [
{
"name": "id",
"value": "exedir"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Error Path",
"variable_name": "ERRORPATH",
"visible": true,
"properties": [
{
"name": "id",
"value": "errorpath"
},
{
"name": "useExecutionPath",
"value": "True"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Output Path",
"variable_name": "OUTPUTPATH",
"visible": true,
"properties": [
{
"name": "id",
"value": "outputpath"
},
{
"name": "useExecutionPath",
"value": "True"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "false",
"editable": true,
"label": "Merge Streams",
"variable_name": "JOIN",
"visible": true,
"properties": [
{
"name": "id",
"value": "join"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "false",
"editable": true,
"label": "Hold Job",
"variable_name": "HOLD",
"visible": true,
"properties": [
{
"name": "id",
"value": "hold"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Script Shell",
"variable_name": "SHELL",
"visible": true,
"properties": [
{
"name": "id",
"value": "shell"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "true",
"editable": true,
"label": "Moab Environment Variables",
"variable_name": "MOABENVIRONMENTVARIABLES",
"visible": true,
"properties": [
{
"name": "id",
"value": "moabenvironmentvariables"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Email Notification List",
"variable_name": "MAILLIST",
"visible": true,
"properties": [
{
"name": "id",
"value": "maillist"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Email Options",
"variable_name": "EMAILOPTIONS",
"visible": true,
"properties": [
{
"name": "id",
"value": "emailoptions"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Generic Resources",
"variable_name": "GENERICRESOURCES",
"visible": true,
"properties": [
{
"name": "id",
"value": "genericresources"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Job Environment Variables",
"variable_name": "Job Environment Variables",
"visible": true,
"properties": [
{
"name": "id",
"value": "jobEnvVariables"
},
{
"name": "enable",
"value": "true"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Default Moab Template",
"variable_name": "MOABTEMPLATE",
"visible": false,
"properties": [
{
"name": "id",
"value": "moabtemplates"
},
{
"name": "enable",
"value": "false"
}
]
},
{
"default_value": "SHARED",
"editable": false,
"label": "Node Access Policy",
"variable_name": "NODEACCESSPOLICY",
"visible": false,
"properties": [
{
"name": "id",
"value": "node-access-policy"
},
{
"name": "enable",
"value": "false"
}
]
},
{
"default_value": "FIRSTAVAILABLE",
"editable": false,
"label": "Node Allocation Policy",
"variable_name": "NODEALLOCATIONPOLICY",
"visible": false,
"properties": [
{
"name": "id",
"value": "node-allocation-policy"
},
{
"name": "enable",
"value": "false"
}
]
},
{
"default_value": "EXACTSET",
"editable": false,
"label": "Node Requested Policy",
"variable_name": "NODESREQUESTEDPOLICY",
"visible": false,
"properties": [
{
"name": "id",
"value": "nodes-requested-policy"
},
{
"name": "enable",
"value": "false"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Operating System",
"variable_name": "OPERATINGSYSTEM",
"visible": false,
"properties": [
{
"name": "id",
"value": "operatingSystem"
},
{
"name": "enable",
"value": "false"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Requested Features",
"variable_name": "FEATURESREQUESTED",
"visible": false,
"properties": [
{
"name": "id",
"value": "features-requested"
},
{
"name": "enable",
"value": "false"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Excluded Features",
"variable_name": "FEATURESEXCLUDED",
"visible": false,
"properties": [
{
"name": "id",
"value": "features-excluded"
},
{
"name": "enable",
"value": "false"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Nodes Requested List",
"variable_name": "NODESREQUESTED",
"visible": false,
"properties": [
{
"name": "id",
"value": "nodes-requested"
},
{
"name": "enable",
"value": "false"
}
]
}
],
"version_description": "Default Free Form Application Template",
"version": 2
}
]
}
You must the correct content type when using the PATCH API. If not specified, the API will consider the type as 'text/html' which might cause side effects in the request processing code.
In this section:
PATCH /api/templates/<history_pk>/history/<version>/
| Parameter | Required | Type | Description | Example |
|---|---|---|---|---|
| history_pk | Yes | String | History ID of the application template | b00ce08c-01ed-4a9d-a916-f587b9f1af44 |
| version | Yes | Integer | Version of the application template | 2 |
The following table identifies the application template attributes that can be changed via PATCH call.
| Name | Required | Type | Description |
|---|---|---|---|
| version_description | No | String | Description of changes in this application template's version. |
Related Topics