Skip to content

odm_api.LinkageAsCuratorApi

All URIs are relative to http://localhost

Method HTTP request Description
delete_link_as_curator DELETE /api/v1/as-curator/links Deletes existing links matching the specified criteria.
get_data_types_as_curator GET /api/v1/as-curator/data-types Lists all available data types.
get_data_types_links_as_curator GET /api/v1/as-curator/data-types/links List all possible links between data types that match the specified criteria.
get_links_by_ids_as_curator POST /api/v1/as-curator/links/get-batch Finds existing links by passing many IDs. Pagination goes through all links matched the criteria.
get_links_by_params_as_curator GET /api/v1/as-curator/links Finds existing links matching the specified criteria.
save_links_as_curator POST /api/v1/as-curator/links Creates new links between objects.

delete_link_as_curator

delete_link_as_curator(first_id, second_id, first_type=first_type, second_type=second_type)

Deletes existing links matching the specified criteria.

This method should be used in case you want to delete the links of an object. Please, keep in mind that deleting a link between Study and Sample will not delete a link between corresponding Sample and it’s signal.

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.LinkageAsCuratorApi(api_client)
    first_id = 'first_id_example' # str | Object ID (accession) (e.g. accession of study)
    second_id = 'second_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_type = 'second_type_example' # str | Type of the object (e.g. study) (optional)

    try:
        # Deletes existing links matching the specified criteria.
        api_instance.delete_link_as_curator(first_id, second_id, first_type=first_type, second_type=second_type)
    except Exception as e:
        print("Exception when calling LinkageAsCuratorApi->delete_link_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
first_id str Object ID (accession) (e.g. accession of study)
second_id str Object ID (accession) (e.g. accession of study)
first_type str Type of the object (e.g. study) [optional]
second_type str Type of the object (e.g. study) [optional]

Return type

void (empty response body)

Authorization

Access-token, Genestack-API-Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Link has been successfully deleted. -
400 Invalid data in request. -
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 links were found. -
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_as_curator

List[str] get_data_types_as_curator()

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.LinkageAsCuratorApi(api_client)

    try:
        # Lists all available data types.
        api_response = api_instance.get_data_types_as_curator()
        print("The response of LinkageAsCuratorApi->get_data_types_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LinkageAsCuratorApi->get_data_types_as_curator: %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_curator

List[SourceTypePair] get_data_types_links_as_curator(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.LinkageAsCuratorApi(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_curator(type=type)
        print("The response of LinkageAsCuratorApi->get_data_types_links_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LinkageAsCuratorApi->get_data_types_links_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
type str Return only links with the specified data type. [optional]

Return type

List[SourceTypePair]

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_curator

ListResponse get_links_by_ids_as_curator(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.LinkageAsCuratorApi(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_curator(request=request)
        print("The response of LinkageAsCuratorApi->get_links_by_ids_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LinkageAsCuratorApi->get_links_by_ids_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
request BatchOfIds [optional]

Return type

ListResponse

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_curator

ListResponse get_links_by_params_as_curator(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.LinkageAsCuratorApi(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_curator(first_id, first_type=first_type, second_id=second_id, second_type=second_type, offset=offset, limit=limit)
        print("The response of LinkageAsCuratorApi->get_links_by_params_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LinkageAsCuratorApi->get_links_by_params_as_curator: %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

ListResponse

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]

save_links_as_curator

save_links_as_curator(links=links)

Creates new links between objects.

This method should be used only in case you need to create links between 2 objects. Links are created both ways (e.g. when linking Object A to Object B it can be done both ways, by linking firstType to secondType and vice versa).

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.link import Link
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.LinkageAsCuratorApi(api_client)
    links = [odm_api.Link()] # List[Link] |  (optional)

    try:
        # Creates new links between objects.
        api_instance.save_links_as_curator(links=links)
    except Exception as e:
        print("Exception when calling LinkageAsCuratorApi->save_links_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
links List[Link] [optional]

Return type

void (empty response body)

Authorization

Access-token, Genestack-API-Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Links were updated or not modified. -
201 At least one new link has been created.Some other links might have been updated or not modified. -
400 Invalid data in request. -
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). -
409 Link cannot be created due to conflict with existing link -
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]