optimserverclientpython.JobExecutionApi

All URIs are relative to https://dbos

Method HTTP request Description
get_job_execution_status GET /jobs/{jobId}/execution Gets the job execution status.
start_async_job_execution POST /jobs/{jobId}/execution Schedule an already created job for an asyncronous execution.
start_sync_job_execution POST /jobs/execution Schedule a syncron job execution.
stop_job_execution DELETE /jobs/{jobId}/execution Request this job to stop its execution.

get_job_execution_status

JobExecutionStatus get_job_execution_status(job_id)

Gets the job execution status.

This API retrieves the current Job execution status.

Example

from __future__ import print_function
import time
import optimserverclientpython
from optimserverclientpython.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = optimserverclientpython.JobExecutionApi()
job_id = 'job_id_example' # str | 

try:
    # Gets the job execution status.
    api_response = api_instance.get_job_execution_status(job_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobExecutionApi->get_job_execution_status: %s\n" % e)

Parameters

Name Type Description Notes
job_id str

Return type

JobExecutionStatus

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

start_async_job_execution

JobDefinition start_async_job_execution(job_id, timeout=timeout)

Schedule an already created job for an asyncronous execution.

This API will ask the optim Server to schedule an asyncron job for being executed on a worker. The execution status of the job is expected to become \“SCHEDULED\“.

Example

from __future__ import print_function
import time
import optimserverclientpython
from optimserverclientpython.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = optimserverclientpython.JobExecutionApi()
job_id = 'job_id_example' # str | 
timeout = 56 # int | Execution timeout after which the job will be abandoned, if it has not been started yet (in ms). (optional)

try:
    # Schedule an already created job for an asyncronous execution.
    api_response = api_instance.start_async_job_execution(job_id, timeout=timeout)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobExecutionApi->start_async_job_execution: %s\n" % e)

Parameters

Name Type Description Notes
job_id str
timeout int Execution timeout after which the job will be abandoned, if it has not been started yet (in ms). [optional]

Return type

JobDefinition

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

start_sync_job_execution

JobSolution start_sync_job_execution(timeout=timeout, job_creation=job_creation)

Schedule a syncron job execution.

This API will ask the Optimization Server to schedule a syncronous job for being executed on a worker. The solution will be returned in the response. Set the timeout query parameter to provide a time limit on job execution. Please note that the synchronous job feature should not be used in High Availability mode with multiple masters.

Example

from __future__ import print_function
import time
import optimserverclientpython
from optimserverclientpython.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = optimserverclientpython.JobExecutionApi()
timeout = 56 # int | Execution timeout after which the job will be abandoned, even if it was started (in ms). (optional)
job_creation = optimserverclientpython.JobCreation() # JobCreation |  (optional)

try:
    # Schedule a syncron job execution.
    api_response = api_instance.start_sync_job_execution(timeout=timeout, job_creation=job_creation)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobExecutionApi->start_sync_job_execution: %s\n" % e)

Parameters

Name Type Description Notes
timeout int Execution timeout after which the job will be abandoned, even if it was started (in ms). [optional]
job_creation JobCreation [optional]

Return type

JobSolution

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: application/json, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

stop_job_execution

JobExecutionStatus stop_job_execution(job_id)

Request this job to stop its execution.

This API allows you to stop the execution of a running job. Notice that stopping a job is an asynchronous operation so the job might not stop immediately after the server responds to this request.

Example

from __future__ import print_function
import time
import optimserverclientpython
from optimserverclientpython.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = optimserverclientpython.JobExecutionApi()
job_id = 'job_id_example' # str | 

try:
    # Request this job to stop its execution.
    api_response = api_instance.stop_job_execution(job_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobExecutionApi->stop_job_execution: %s\n" % e)

Parameters

Name Type Description Notes
job_id str

Return type

JobExecutionStatus

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]