Table of Contents

Jobs: create, edit, delete

To create, edit or delete jobs, use the command resource/update_job:

svc=resource/update_job&params={"itemId":<long>,
				"id":<long>,
				"callMode":<text>,
				"n":<text>,
				"d":<text>,
				"r":<text>,
				"at":<uint>,
				"m":<uint>,
                                "fl":<uint>,/* Used in the request only when sending a test job*/
				"tz":<int>,
				"l":<text>,
				"e":<bool>,
				"sch":{
					"f1":<uint>,
					"f2":<uint>,
					"t1":<uint>,
					"t2":<uint>,
					"m":<uint>,
					"y":<uint>,
					"w":<uint>
				},					
				"act":{	
					"t":<text>,
					"p":{
						<text>:<text>,
						...
					}					
				}}

Parameters

Name Description
itemId resource ID
id job ID (0 to create)
callMode action: create, update, delete

Other parameters are required only for creating and updating, you can see them in the chapter Jobs: detailed information.

Response

On create and edit:

[
	<long>,		/* job ID */
	{
		"id":<long>,	/* job ID */
		"n":<text>,	/* name */
		"d":<text>,	/* description */
		"m":<uint>,	/* maximal executions count, 0 - unlimited */
		"fl":<uint>,	/* delete job after maximal executions count, 1 - yes ,used only when sending a test task*/
		"st":{		/* state */
			"e":<uint>,	/* enabled/disabled */
			"c":<uint>,	/* executions count */
			"l":<uint>	/* time of last execution */
		},
		"act":<text>,	/* action */
		"ct":<uint>,    /* creation time */  
		"mt":<uint>     /* last modification time */
	}
]

Types of all possible actions are described in the chapter Detailed information about jobs: Action types.

On delete:

[
	<long>,		/* job ID */
	null
]