Job Invocation API

Latest response

Is there something special you have to do when calling the job_invocation API call to schedule a job in the future?
If I use this json (to run now) the job runs successfully:

{
    "job_invocation": {
        "inputs": {
            "action": "restart"
        },
        "job_template_id": 75,
        "targeting_type": "static_query",
        "search_query": "name = client.example.com"
    }
}

If I use this json, the code schedule the job, but it's never executed.

{
    "job_invocation": {
        "inputs": {
            "action": "restart"
        },
        "job_template_id": 75,
        "targeting_type": "static_query",
        "scheduling": {
            "start_at": "2016-09-23 19:00:00",
            "start_before": "2016-09-23 19:15:00"
        },
        "search_query": "name = client.example.com"
    }
}

I've tried various permutations of start_at and start_before, but still can't the job to run against the client.
Here's the actual job shown in Satellite

api/job_invocations/54 |json_reformat
{
  "id": 54,
  "description": "restart host",
  "job_category": "Power",
  "targeting_id": 54,
  "status": 2,
  "start_at": "2016-09-23 19:00:00 UTC",
  "status_label": "queued",
  "dynflow_task": {
    "id": "adf82bca-905c-4404-bb60-eef43fade182",
    "state": "scheduled"
  },
  "succeeded": "N/A",
  "failed": "N/A",
  "pending": "N/A",
  "total": "N/A",
  "targeting": {
    "bookmark_id": null,
    "search_query": "name = client.example.com",
    "targeting_type": "static_query",
    "user_id": 4,
    "hosts": [
      {
        "name": "client.example.com",
        "id": 52
      }
    ]
  },
  "template_invocations": [

  ],
  "mode": "future",
  "scheduling": {
    "start_at": "2016-09-23 19:00:00 UTC",
    "start_before": "2016-09-23 19:15:00 UTC"
  }
}

Thanks!

Responses