fbpx
GEThttps://api.spotinst.io/spectrum/events/job/{JOB_ID}?accountId={ACCOUNT_ID}

Update one or more parameters in your Job. Use the Job JSON in the call body to update the Job. Only the specified fields will be affected. For more information on the body parameters please checkout the Job/Create documentation

Please note: while updating the config fields, the action property must be supplied in each update request and it cannot be updated. i.e it must be equal to the existing job’s action.

URL Parameters

Parameter Type Description
JOB_ID * String

The Job id you want to update

Example: sej-12345678
ACCOUNT_ID String

Account ID from Spotinst console

Example: act-12345
Request - Update cron

Headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer ${TOKEN}"
}
Body
Copied!
Downloaded!
{
	"job": {
		"cronExpression": "30 * * * *"
	}
}
Request - Update config

Headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer ${TOKEN}"
}
Body
Copied!
Downloaded!
{
	"job": {
		"action": "INVOKE_FUNCTION",
		"config": {
			"queryParams": [{
				"key": "Foo",
				"value": "Bar"
			}]
		}
	}
}

Body Attributes


  • job.resourceId String
    The Spotinst resource that the Job will affect. For example, if the job is “INVOKE_FUNCTION” then the resource id will be an id of a function.
  • job.action String
    The Type of action. Currently we support “INVOKE_FUNCTION
  • job.config.body String
    The Body the function will receive
  • job.config.queryParams.key String
    the Key for the Parameter
  • job.config.queryParams.value String
    The value for the key
  • job.isEnables Boolean
    The state of the Job - true for enabling the Job
  • job.conExpression String
    The Cron Expression ("* * * * *") that will set the schedualing of the Job (does not support seconds). Please use https://crontab.guru/ to validate you expression
Response - 200

Headers
{
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "status": {
    "code": 200,
    "message": "OK"
  }
}