Skip to content

Latest commit

 

History

History
231 lines (163 loc) · 6.07 KB

File metadata and controls

231 lines (163 loc) · 6.07 KB

nexus_api_python_client.TasksApi

All URIs are relative to http://localhost/service/rest

Method HTTP request Description
get_task_by_id GET /v1/tasks/{id} Get a single task by id
get_tasks GET /v1/tasks List tasks
run POST /v1/tasks/{id}/run Run task
stop POST /v1/tasks/{id}/stop Stop task

get_task_by_id

TaskXO get_task_by_id(id)

Get a single task by id

Example

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

# Enter a context with an instance of the API client
with nexus_api_python_client.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = nexus_api_python_client.TasksApi(api_client)
    id = 'id_example' # str | Id of the task to get

    try:
        # Get a single task by id
        api_response = api_instance.get_task_by_id(id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TasksApi->get_task_by_id: %s\n" % e)

Parameters

Name Type Description Notes
id str Id of the task to get

Return type

TaskXO

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -
404 Task not found -

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

get_tasks

PageTaskXO get_tasks(type=type)

List tasks

Example

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

# Enter a context with an instance of the API client
with nexus_api_python_client.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = nexus_api_python_client.TasksApi(api_client)
    type = 'type_example' # str | Type of the tasks to get (optional)

    try:
        # List tasks
        api_response = api_instance.get_tasks(type=type)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TasksApi->get_tasks: %s\n" % e)

Parameters

Name Type Description Notes
type str Type of the tasks to get [optional]

Return type

PageTaskXO

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -

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

run

run(id)

Run task

Example

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

# Enter a context with an instance of the API client
with nexus_api_python_client.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = nexus_api_python_client.TasksApi(api_client)
    id = 'id_example' # str | Id of the task to run

    try:
        # Run task
        api_instance.run(id)
    except ApiException as e:
        print("Exception when calling TasksApi->run: %s\n" % e)

Parameters

Name Type Description Notes
id str Id of the task to run

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 Task was run -
404 Task not found -
405 Task is disabled -

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

stop

stop(id)

Stop task

Example

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

# Enter a context with an instance of the API client
with nexus_api_python_client.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = nexus_api_python_client.TasksApi(api_client)
    id = 'id_example' # str | Id of the task to stop

    try:
        # Stop task
        api_instance.stop(id)
    except ApiException as e:
        print("Exception when calling TasksApi->stop: %s\n" % e)

Parameters

Name Type Description Notes
id str Id of the task to stop

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 Task was stopped -
404 Task not found -
409 Unable to stop task -

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