odm_api.LinkageAsUserApi¶
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| get_data_types_as_user | GET /api/v1/as-user/data-types | Lists all available data types. |
| get_data_types_links_as_user | GET /api/v1/as-user/data-types/links | List all possible links between data types that match the specified criteria. |
| get_links_by_ids_as_user | POST /api/v1/as-user/links/get-batch | Finds existing links by passing many IDs. Pagination goes through all links matched the criteria. |
| get_links_by_params_as_user | GET /api/v1/as-user/links | Finds existing links matching the specified criteria. |
get_data_types_as_user¶
List[str] get_data_types_as_user()
Lists all available data types.
This endpoint is for instructional uses and can be used to get the latest list of Data Types.
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.LinkageAsUserApi(api_client)
try:
# Lists all available data types.
api_response = api_instance.get_data_types_as_user()
print("The response of LinkageAsUserApi->get_data_types_as_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LinkageAsUserApi->get_data_types_as_user: %s\n" % e)
Parameters¶
This endpoint does not need any parameter.
Return type¶
List[str]
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 | The request was successful. The returned value is a list of objects. | - |
| 400 | Entities cannot be retrieved. | - |
| 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). | - |
| 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]
get_data_types_links_as_user¶
List[SourceTypePair] get_data_types_links_as_user(type=type)
List all possible links between data types that match the specified criteria.
This endpoint should be used for instructional needs, and can be used in order to get the links between the Data Types.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.source_type_pair import SourceTypePair
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.LinkageAsUserApi(api_client)
type = 'type_example' # str | Return only links with the specified data type. (optional)
try:
# List all possible links between data types that match the specified criteria.
api_response = api_instance.get_data_types_links_as_user(type=type)
print("The response of LinkageAsUserApi->get_data_types_links_as_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LinkageAsUserApi->get_data_types_links_as_user: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| type | str | Return only links with the specified data type. | [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 | The request was successful. The returned value is a list of objects. | - |
| 400 | Entities cannot be retrieved. | - |
| 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). | - |
| 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]
get_links_by_ids_as_user¶
ListResponse get_links_by_ids_as_user(request=request)
Finds existing links by passing many IDs. Pagination goes through all links matched the criteria.
Please make sure to use that endpoint for batch calls only. You are not allowed to pass 'mixed' objects. e.g. Studies and Samples at the same time. Please always specify firstType.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.batch_of_ids import BatchOfIds
from odm_api.models.list_response import ListResponse
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.LinkageAsUserApi(api_client)
request = odm_api.BatchOfIds() # BatchOfIds | (optional)
try:
# Finds existing links by passing many IDs. Pagination goes through all links matched the criteria.
api_response = api_instance.get_links_by_ids_as_user(request=request)
print("The response of LinkageAsUserApi->get_links_by_ids_as_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LinkageAsUserApi->get_links_by_ids_as_user: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| request | BatchOfIds | [optional] |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: application/json
- Accept: application/json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The request was successful. The returned value is a list of objects. | - |
| 400 | Entities cannot be retrieved. | - |
| 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). | - |
| 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]
get_links_by_params_as_user¶
ListResponse get_links_by_params_as_user(first_id, first_type=first_type, second_id=second_id, second_type=second_type, offset=offset, limit=limit)
Finds existing links matching the specified criteria.
Please make sure that this endpoint should be used only for getting all links to a specific object. In case you specify both firstId and secondId an expected answer would be true for existing links and false for no link between the objects.
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.list_response import ListResponse
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.LinkageAsUserApi(api_client)
first_id = 'first_id_example' # str | Object ID (accession) (e.g. accession of study)
first_type = 'first_type_example' # str | Type of the object (e.g. study) (optional)
second_id = 'second_id_example' # str | Object ID (accession) (e.g. accession of study) (optional)
second_type = 'second_type_example' # str | Type of the object (e.g. study) (optional)
offset = 0 # int | Param says to skip that many links before beginning to return links. (optional) (default to 0)
limit = 1000 # int | Param says to limit the count of returned links. (optional) (default to 1000)
try:
# Finds existing links matching the specified criteria.
api_response = api_instance.get_links_by_params_as_user(first_id, first_type=first_type, second_id=second_id, second_type=second_type, offset=offset, limit=limit)
print("The response of LinkageAsUserApi->get_links_by_params_as_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LinkageAsUserApi->get_links_by_params_as_user: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| first_id | str | Object ID (accession) (e.g. accession of study) | |
| first_type | str | Type of the object (e.g. study) | [optional] |
| second_id | str | Object ID (accession) (e.g. accession of study) | [optional] |
| second_type | str | Type of the object (e.g. study) | [optional] |
| offset | int | Param says to skip that many links before beginning to return links. | [optional] [default to 0] |
| limit | int | Param says to limit the count of returned links. | [optional] [default to 1000] |
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 | The request was successful. The returned value is a list of objects. | - |
| 400 | Entities cannot be retrieved. | - |
| 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). | - |
| 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]