odm_api.TasksAPIApi¶
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| get_task_info | GET /api/v1/tasks/{id} | Retrieve information about any ODM task. |
| publish_all_studies | POST /api/v1/tasks/publish-versions | Asynchronous task that publishes all pending versions across all studies in the instance. |
get_task_info¶
TaskInfo get_task_info(id)
Retrieve information about any ODM task.
Supply the accession (id) of an ODM task to retrieve metadata about that task.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.task_info import TaskInfo
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.TasksAPIApi(api_client)
id = 'id_example' # str | Accession of the task.
try:
# Retrieve information about any ODM task.
api_response = api_instance.get_task_info(id)
print("The response of TasksAPIApi->get_task_info:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TasksAPIApi->get_task_info: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Accession of the task. |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | Task information. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 404 | No object exists with the given ID. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
publish_all_studies¶
TaskInfo publish_all_studies(version_message=version_message)
Asynchronous task that publishes all pending versions across all studies in the instance.
This endpoint publishes all information from drafts and creates new metadata versions for each study/associated objects with unpublished changes. Only curators with the ACCESS_ALL_DATA permission can use this method.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.task_info import TaskInfo
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.TasksAPIApi(api_client)
version_message = 'version_message_example' # str | Supply text to name this version. If not supplied the version name is set to “Auto-published by API call” (optional)
try:
# Asynchronous task that publishes all pending versions across all studies in the instance.
api_response = api_instance.publish_all_studies(version_message=version_message)
print("The response of TasksAPIApi->publish_all_studies:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TasksAPIApi->publish_all_studies: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| version_message | str | Supply text to name this version. If not supplied the version name is set to “Auto-published by API call” | [optional] |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | Task information. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 403 | Forbidden | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]