(Click to open topic with navigation)
The PATCH method lets you modify specific attributes of an existing template. To replace an existing template in its entirety with your modified template, use the PUT method. See 4.17 Modify Template.
In this topic:
PATCH /api/templates/<id>
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
id | Yes | Integer | The ID of the template | 1 |
The following table identifies the template attributes that can be changed via PATCH call.
Name | Required | Type | Description |
---|---|---|---|
name | Yes | String | User friendly name |
permissions | No | List | List of permissions. See corresponding section of this document for more details |
published | No | Boolean | Template's status: published or unpublished. If the template unpublished then only owner can see it |
sections | No | List | List of sections. See "Section" section bellow |
widgets | No | List | List of widgets. See "Widget" section bellow |
This section provides an example of how to update template 1 with a new name and with the published tag unset.
PATCH /api/templates/1/
{
"name": "My New Name",
"published": false
}
{
"url": "http://localhost:8080/api/templates/1/",
"assigned": "ALL",
"date": "2015-09-01",
"id": 1,
"name": "My New Name",
"owner": "hpotter",
"permissions": [
{
"name": "ALL",
"type": "account"
},
{
"name": "ALL",
"type": "group"
},
{
"name": "ALL",
"type": "user"
}
],
"published": false,
"sections": [
{
"name": "defaults",
"value": "Basic Job Settings"
},
{
"name": "timeManagement",
"value": "Time Management"
},
{
"name": "credentials",
"value": "Credentials"
},
{
"name": "resources",
"value": "Resources"
},
{
"name": "dataManagement",
"value": "Data Management"
},
{
"name": "custom",
"value": "Custom Settings"
},
{
"name": "basic",
"value": "Basic Settings"
},
{
"name": "advanced",
"value": "Advanced Settings"
}
],
"use": 0,
"widgets": [
{
"default_value": "",
"editable": true,
"label": "Name",
"variable_name": "NAME",
"visible": true,
"properties": [
{
"name": "id",
"value": "name"
}
]
},
{
"default_value": "0",
"editable": true,
"label": "Duration",
"variable_name": "DURATION",
"visible": true,
"properties": [
{
"name": "id",
"value": "duration"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Job Arrays",
"variable_name": "arrays",
"visible": true,
"properties": [
{
"name": "id",
"value": "arrays"
},
{
"name": "enable",
"value": "true"
},
{
"name": "start-value",
"value": "0"
},
{
"name": "end-value",
"value": "1"
},
{
"name": "start-variable",
"value": "STARTINDEX"
},
{
"name": "end-variable",
"value": "ENDINDEX"
}
]
},
{
"default_value": "0",
"editable": false,
"label": "Delay Start By",
"variable_name": "ELIGIBLEDATE",
"visible": false,
"properties": [
{
"name": "id",
"value": "eligibledate"
}
]
},
{
"default_value": "0",
"editable": false,
"label": "User Priority",
"variable_name": "USERPRIORITY",
"visible": false,
"properties": [
{
"name": "id",
"value": "priority"
},
{
"name": "enable",
"value": "false"
}
]
},
{
"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": false,
"properties": [
{
"name": "id",
"value": "account"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Queue / Class",
"variable_name": "DESTINATIONQUEUE",
"visible": false,
"properties": [
{
"name": "id",
"value": "destinationQueue"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Quality of Service",
"variable_name": "QOS",
"visible": false,
"properties": [
{
"name": "id",
"value": "qos"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Number of Cores",
"variable_name": "NUMOFCORES",
"visible": true,
"properties": [
{
"name": "id",
"value": "cpupernode"
}
]
},
{
"default_value": "0.5",
"editable": true,
"label": "Total Memory (GB)",
"variable_name": "MEMORYPERNODE",
"visible": true,
"properties": [
{
"name": "id",
"value": "memorypernode"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Architecture",
"variable_name": "ARCHITECTURE",
"visible": true,
"properties": [
{
"name": "id",
"value": "architecture"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Execution Path",
"variable_name": "EXECUTIONDIRECTORY",
"visible": false,
"properties": [
{
"name": "id",
"value": "exedir"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Error Path",
"variable_name": "ERRORPATH",
"visible": false,
"properties": [
{
"name": "id",
"value": "errorpath"
}
]
},
{
"default_value": "",
"editable": true,
"label": "Output Path",
"variable_name": "OUTPUTPATH",
"visible": false,
"properties": [
{
"name": "id",
"value": "outputpath"
}
]
},
{
"default_value": "false",
"editable": false,
"label": "Merge Streams",
"variable_name": "JOIN",
"visible": false,
"properties": [
{
"name": "id",
"value": "join"
}
]
},
{
"default_value": "false",
"editable": false,
"label": "Hold Job",
"variable_name": "HOLD",
"visible": false,
"properties": [
{
"name": "id",
"value": "hold"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Script Shell",
"variable_name": "SHELL",
"visible": false,
"properties": [
{
"name": "id",
"value": "shell"
}
]
},
{
"default_value": "true",
"editable": false,
"label": "Moab Environment Variables",
"variable_name": "MOABENVIRONMENTVARIABLES",
"visible": false,
"properties": [
{
"name": "id",
"value": "moabenvironmentvariables"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Email Notification List",
"variable_name": "MAILLIST",
"visible": false,
"properties": [
{
"name": "id",
"value": "maillist"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Email Options",
"variable_name": "EMAILOPTIONS",
"visible": false,
"properties": [
{
"name": "id",
"value": "emailoptions"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Generic Resources",
"variable_name": "GENERICRESOURCES",
"visible": false,
"properties": [
{
"name": "id",
"value": "genericresources"
}
]
},
{
"default_value": "",
"editable": false,
"label": "Feature Tags",
"variable_name": "FEATURETAGS",
"visible": false,
"properties": [
{
"name": "id",
"value": "featuretags"
}
]
}
]
}
Related Topics