REST API: Is it possible to update job name

Using the REST API is it possible to update an existing job’s name (or any of the Extra Info columns for that matter)?
In the documentation docs.thinkboxsoftware.com/produc … -jobs.html
I see “Save Job: {put} hostname:portnumber/api/jobs
I tried providing an existing id with the job, and it did remove that job replaced by a new job, but it seems to want the entire job provided. Also it seemed to replace the job with a new job ID.

I would like to be able to update the Name by providing the _id and the new Name leaving any undefined parameters as they were in the original job. The job might be a dependency for other jobs so the changing id makes me think it might loose that connection.

Thanks

I believe under the hood we’re taking what you put in via the API and passing that to the database.

The system doesn’t yet support PATCH requests where you would put only a partial change in place. For the time being, the best idea is to grab the whole job, change the field you want to be different, then post the whole thing back up. I don’t believe it’s supposed to be creating a new job if the ID is provided.

Do you have some test code I could throw at my Web Service over here?

Hi, thanks for the reply. It just occured to me that I can create a custom webservice endpoint. Here is what I ended up doing as a test…

10.1.58.10:8082/jobs/priority?jo … riority=98

.\custom\scripts\WebService\jobs\priority.py

[code]from System.IO import *
from System.Text import *

from Deadline.Scripting import *
def main( dlArgs, qsArgs ):
returnVal = “{\n”
returnVal += “dlArgs:{\n”
for key, value in dlArgs.iteritems():
returnVal += ‘"’+key + ‘":"’ + str(value) + ‘",\n’
returnVal += “},\n”
returnVal += “qsArgs:{\n”
for key, value in qsArgs.iteritems():
returnVal += ‘"’+key + ‘":"’ + str(value) + ‘",\n’
returnVal += “},\n”
job = RepositoryUtils.GetJob(qsArgs[‘jobId’], True)
returnVal += ‘“message”:“Priority was ’ + str(job.JobPriority) + '”\n’
job.JobPriority = qsArgs[‘priority’]
RepositoryUtils.SaveJob(job)
returnVal += “}\n”

return returnVal

[/code]

ooooOOOoooo Thats cool.

Ah, good thinking! I often forget about the classic web service angle.