odm_api.TransformationJobsApi¶
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| get_api_v1_transformations_jobs | GET /api/v1/transformations/jobs | List transformation jobs |
| get_api_v1_transformations_jobs_by_id | GET /api/v1/transformations/jobs/{id} | Get a transformation job |
| post_api_v1_transformations_jobs | POST /api/v1/transformations/jobs | Submit a new transformation job |
| post_api_v1_transformations_jobs_by_id_cancel | POST /api/v1/transformations/jobs/{id}/cancel | Cancel a running transformation job |
| post_api_v1_transformations_jobs_by_id_logs | POST /api/v1/transformations/jobs/{id}/logs | Retrieve transformation job logs |
get_api_v1_transformations_jobs¶
TransformationJobPage get_api_v1_transformations_jobs(limit=limit, offset=offset, include_archived=include_archived)
List transformation jobs
Returns a paginated list of submitted transformation jobs, ordered from most to least recently created. Each entry includes the job's current state, timing, compute resources, and the image and configuration it was run with. Use the limit and offset query parameters to paginate through the results.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.transformation_job_page import TransformationJobPage
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.TransformationJobsApi(api_client)
limit = 100 # int | Maximum number of items to return per page. (optional) (default to 100)
offset = 0 # int | Number of items to skip from the start of the list. Use with limit to paginate through results. (optional) (default to 0)
include_archived = True # bool | If `true`, archived jobs are included in the results. Defaults to `false`. (optional)
try:
# List transformation jobs
api_response = api_instance.get_api_v1_transformations_jobs(limit=limit, offset=offset, include_archived=include_archived)
print("The response of TransformationJobsApi->get_api_v1_transformations_jobs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TransformationJobsApi->get_api_v1_transformations_jobs: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Maximum number of items to return per page. | [optional] [default to 100] |
| offset | int | Number of items to skip from the start of the list. Use with limit to paginate through results. | [optional] [default to 0] |
| include_archived | bool | If `true`, archived jobs are included in the results. Defaults to `false`. | [optional] |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/json, application/problem+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The request was successful. The returned value is a page of transformation jobs. | - |
| 0 | Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_api_v1_transformations_jobs_by_id¶
TransformationJob get_api_v1_transformations_jobs_by_id(id)
Get a transformation job
Returns the details of a single transformation job, identified by its id, including its current lifecycle state, timing, the image and configuration references, and granted compute resources.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.transformation_job import TransformationJob
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.TransformationJobsApi(api_client)
id = 56 # int | Unique numeric identifier of the transformation job.
try:
# Get a transformation job
api_response = api_instance.get_api_v1_transformations_jobs_by_id(id)
print("The response of TransformationJobsApi->get_api_v1_transformations_jobs_by_id:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TransformationJobsApi->get_api_v1_transformations_jobs_by_id: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Unique numeric identifier of the transformation job. |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/json, application/problem+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The request was successful. The returned value is the transformation job. | - |
| 0 | Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
post_api_v1_transformations_jobs¶
TransformationJobId post_api_v1_transformations_jobs(transformation_job_create_fields)
Submit a new transformation job
Submits a new transformation job. The job runs the referenced transformation image over the supplied input file accessions, optionally using a specified configuration and compute overrides (memory_size, volume_size). Set dry_run to true to validate the run without producing output. Returns the id of the created job.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.transformation_job_create_fields import TransformationJobCreateFields
from odm_api.models.transformation_job_id import TransformationJobId
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.TransformationJobsApi(api_client)
transformation_job_create_fields = odm_api.TransformationJobCreateFields() # TransformationJobCreateFields |
try:
# Submit a new transformation job
api_response = api_instance.post_api_v1_transformations_jobs(transformation_job_create_fields)
print("The response of TransformationJobsApi->post_api_v1_transformations_jobs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TransformationJobsApi->post_api_v1_transformations_jobs: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| transformation_job_create_fields | TransformationJobCreateFields |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: application/json
- Accept: application/json, application/problem+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The job was submitted successfully. The returned value is the identifier of the new job. | - |
| 0 | Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
post_api_v1_transformations_jobs_by_id_cancel¶
post_api_v1_transformations_jobs_by_id_cancel(id)
Cancel a running transformation job
Requests cancellation of a running transformation job, identified by its id. Cancellation moves the job to the CANCELLED terminal state. Jobs that have already reached a terminal state and been archived cannot be cancelled.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.TransformationJobsApi(api_client)
id = 56 # int | Unique numeric identifier of the transformation job.
try:
# Cancel a running transformation job
api_instance.post_api_v1_transformations_jobs_by_id_cancel(id)
except Exception as e:
print("Exception when calling TransformationJobsApi->post_api_v1_transformations_jobs_by_id_cancel: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Unique numeric identifier of the transformation job. |
Return type¶
void (empty response body)
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/problem+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 204 | The cancellation request was accepted. The job is transitioning to the `CANCELLED` state. | - |
| 0 | Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
post_api_v1_transformations_jobs_by_id_logs¶
bytes post_api_v1_transformations_jobs_by_id_logs(id, logs_payload)
Retrieve transformation job logs
Retrieves the execution logs for a transformation job, identified by its id. The logs are returned as a binary stream. Use the tail_lines in the request body to retrieve only the most recent N lines; omit it to retrieve the full log.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.logs_payload import LogsPayload
from odm_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'
# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = odm_api.TransformationJobsApi(api_client)
id = 56 # int | Unique numeric identifier of the transformation job.
logs_payload = odm_api.LogsPayload() # LogsPayload |
try:
# Retrieve transformation job logs
api_response = api_instance.post_api_v1_transformations_jobs_by_id_logs(id, logs_payload)
print("The response of TransformationJobsApi->post_api_v1_transformations_jobs_by_id_logs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TransformationJobsApi->post_api_v1_transformations_jobs_by_id_logs: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Unique numeric identifier of the transformation job. | |
| logs_payload | LogsPayload |
Return type¶
bytes
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: application/json
- Accept: application/octet-stream, application/problem+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The request was successful. The returned value is the job log stream. | - |
| 0 | Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]