odm_api.PreparationSPoTAsCuratorApi¶
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| get_preparation_as_curator | GET /api/v1/as-curator/preparations/{id} | Retrieve a single preparation object by ID (accession) |
| get_preparation_by_version_as_curator | GET /api/v1/as-curator/preparations/{id}/versions/{version} | Retrieve a single preparation object by ID (accession) |
| get_preparation_versions_as_curator | GET /api/v1/as-curator/preparations/{id}/versions | Retrieve a list of object versions by ID |
| get_preparations_by_group_as_curator | GET /api/v1/as-curator/preparations/by/group/{id} | Retrieve preparations related to the given group |
| search_preparations_as_curator | GET /api/v1/as-curator/preparations | List or search for preparation metadata objects |
| update_preparation_as_curator | PATCH /api/v1/as-curator/preparations/{id} | Update a preparation object |
get_preparation_as_curator¶
object get_preparation_as_curator(id, response_format=response_format, returned_metadata_fields=returned_metadata_fields)
Retrieve a single preparation object by ID (accession)
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.response_format import ResponseFormat
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.PreparationSPoTAsCuratorApi(api_client)
id = 'id_example' # str | Unique identifier (accession) of the object.
response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template, default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)
try:
# Retrieve a single preparation object by ID (accession)
api_response = api_instance.get_preparation_as_curator(id, response_format=response_format, returned_metadata_fields=returned_metadata_fields)
print("The response of PreparationSPoTAsCuratorApi->get_preparation_as_curator:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PreparationSPoTAsCuratorApi->get_preparation_as_curator: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Unique identifier (accession) of the object. | |
| response_format | ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. | [optional] |
| returned_metadata_fields | str | The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template, default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. | [optional] |
Return type¶
object
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 the object. | - |
| 400 | The supplied object ID is invalid. | - |
| 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]
get_preparation_by_version_as_curator¶
object get_preparation_by_version_as_curator(id, version, response_format=response_format, returned_metadata_fields=returned_metadata_fields)
Retrieve a single preparation object by ID (accession)
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.response_format import ResponseFormat
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.PreparationSPoTAsCuratorApi(api_client)
id = 'id_example' # str | Unique identifier (accession) of the object.
version = 'version_example' # str | Unique version of the object.
response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template, default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)
try:
# Retrieve a single preparation object by ID (accession)
api_response = api_instance.get_preparation_by_version_as_curator(id, version, response_format=response_format, returned_metadata_fields=returned_metadata_fields)
print("The response of PreparationSPoTAsCuratorApi->get_preparation_by_version_as_curator:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PreparationSPoTAsCuratorApi->get_preparation_by_version_as_curator: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Unique identifier (accession) of the object. | |
| version | str | Unique version of the object. | |
| response_format | ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. | [optional] |
| returned_metadata_fields | str | The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template, default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. | [optional] |
Return type¶
object
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 the object. | - |
| 400 | The supplied object ID is invalid. | - |
| 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]
get_preparation_versions_as_curator¶
List[CommitInfo] get_preparation_versions_as_curator(id)
Retrieve a list of object versions by ID
Example¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.commit_info import CommitInfo
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.PreparationSPoTAsCuratorApi(api_client)
id = 'id_example' # str | Unique identifier (accession) of the object.
try:
# Retrieve a list of object versions by ID
api_response = api_instance.get_preparation_versions_as_curator(id)
print("The response of PreparationSPoTAsCuratorApi->get_preparation_versions_as_curator:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PreparationSPoTAsCuratorApi->get_preparation_versions_as_curator: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Unique identifier (accession) of the object. |
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 the list of object versions. | - |
| 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_preparations_by_group_as_curator¶
ListResponse get_preparations_by_group_as_curator(id, response_format=response_format, returned_metadata_fields=returned_metadata_fields, page_offset=page_offset, page_limit=page_limit)
Retrieve preparations related to the given group
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.models.response_format import ResponseFormat
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.PreparationSPoTAsCuratorApi(api_client)
id = 'id_example' # str | Unique identifier (accession) of the object.
response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template, default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)
page_offset = 56 # int | Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. (optional)
page_limit = 56 # int | Maximum number of results to return per page (see Paging above). This value must be between 0 and 2000 (inclusive). The default is 2000. (optional)
try:
# Retrieve preparations related to the given group
api_response = api_instance.get_preparations_by_group_as_curator(id, response_format=response_format, returned_metadata_fields=returned_metadata_fields, page_offset=page_offset, page_limit=page_limit)
print("The response of PreparationSPoTAsCuratorApi->get_preparations_by_group_as_curator:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PreparationSPoTAsCuratorApi->get_preparations_by_group_as_curator: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Unique identifier (accession) of the object. | |
| response_format | ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. | [optional] |
| returned_metadata_fields | str | The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template, default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. | [optional] |
| page_offset | int | Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. | [optional] |
| page_limit | int | Maximum number of results to return per page (see Paging above). This value must be between 0 and 2000 (inclusive). The default is 2000. | [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 | The supplied object ID is invalid. | - |
| 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]
search_preparations_as_curator¶
ListResponse search_preparations_as_curator(response_format=response_format, filter=filter, query=query, search_specific_terms=search_specific_terms, returned_metadata_fields=returned_metadata_fields, sort=sort, page_limit=page_limit, page_offset=page_offset)
List or search for preparation metadata objects
Retrieve preparation metadata objects by searching/listing preparation metadata.
Metadata full-text queries¶
Single words can be supplied as is, otherwise use speech marks (") to quote queries that include whitespace. Speech marks and backslash characters in the query need to be escaped with a backslash (\).
Metadata filters¶
Metadata filters are key-value pairs joined by an operator. The = operator matches literal values/string. The != operator matches anything except the literal value/string. The < or > operators match numerical results that are less or greater than the supplied value. Strings containing whitespace need to be quoted with (").
Combinations¶
Metadata queries/filters for the same parameter can be combined with &&, AND, || and OR operators, using white-space to separate out the terms and operators. Parentheses ( ) can be used for complex expressions.
Paging¶
For performance reasons this endpoint returns results in "pages" of limited size. In order to retrieve all matching results the client needs to request multiple pages starting from an offset to the first result. You can do this using the pageOffset query parameter. A value of 0 (the default) instructs the server to return the first page of results, 100 would return a page of results starting from the 101st result and so on. To return all results iterate through pages using pageOffset values of n*pageLimit until the resultsExhausted response field is true.
List operation¶
This endpoint can be called with no query parameter. Doing so returns a list of all variant 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.models.response_format import ResponseFormat
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.PreparationSPoTAsCuratorApi(api_client)
response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
filter = 'filter_example' # str | Filter by preparation metadata (key-value metadata pair(s)). E.g. `Digestion=Trypsin` (optional)
query = 'query_example' # str | Search for preparation objects via a full-text query over all preparation metadata fields. E.g. `\"reversed-phase liquid chromatography\"`. Queries matching dictionary terms are automatically expanded to include synonyms. (optional)
search_specific_terms = True # bool | If the full-text query term is present in an ODM dictionary, enabling this parameter will modify the query to include child terms of the full-text query. For example, the search query \"Body fluid\" can be expanded to include the term \"Blood\" (a child term of \"Body fluid\") so files containing either \"Body fluid\" or \"Blood\" in their metadata will be returned in the search results. The parent-child relationship is defined by the key \"broaders\" or \"subClassOf\" in the dictionary. If the full query term is not present in a dictionary then this parameter has no effect. (optional)
returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template, default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)
sort = 'sort_example' # str | Attribute to sort by, with optional ascending/descending marker, of the form `\"[+|-]<key_name>\"`. No marker or `\"+\"` indicates ascending sort, and `\"-\"` indicates descending sort. *Default:* sort by ID in ascending order. (optional)
page_limit = 56 # int | Maximum number of results to return per page (see Paging above). This value must be between 0 and 2000 (inclusive). The default is 2000. (optional)
page_offset = 56 # int | Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. (optional)
try:
# List or search for preparation metadata objects
api_response = api_instance.search_preparations_as_curator(response_format=response_format, filter=filter, query=query, search_specific_terms=search_specific_terms, returned_metadata_fields=returned_metadata_fields, sort=sort, page_limit=page_limit, page_offset=page_offset)
print("The response of PreparationSPoTAsCuratorApi->search_preparations_as_curator:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PreparationSPoTAsCuratorApi->search_preparations_as_curator: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| response_format | ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. | [optional] |
| filter | str | Filter by preparation metadata (key-value metadata pair(s)). E.g. `Digestion=Trypsin` | [optional] |
| query | str | Search for preparation objects via a full-text query over all preparation metadata fields. E.g. `\"reversed-phase liquid chromatography\"`. Queries matching dictionary terms are automatically expanded to include synonyms. | [optional] |
| search_specific_terms | bool | If the full-text query term is present in an ODM dictionary, enabling this parameter will modify the query to include child terms of the full-text query. For example, the search query \"Body fluid\" can be expanded to include the term \"Blood\" (a child term of \"Body fluid\") so files containing either \"Body fluid\" or \"Blood\" in their metadata will be returned in the search results. The parent-child relationship is defined by the key \"broaders\" or \"subClassOf\" in the dictionary. If the full query term is not present in a dictionary then this parameter has no effect. | [optional] |
| returned_metadata_fields | str | The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template, default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. | [optional] |
| sort | str | Attribute to sort by, with optional ascending/descending marker, of the form `\"[+ | -]<key_name>\"`. No marker or `\"+\"` indicates ascending sort, and `\"-\"` indicates descending sort. Default: sort by ID in ascending order. |
| page_limit | int | Maximum number of results to return per page (see Paging above). This value must be between 0 and 2000 (inclusive). The default is 2000. | [optional] |
| page_offset | int | Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. | [optional] |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/json, text/tab-separated-values
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The request was successful. The returned value is a list of objects. | - |
| 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]
update_preparation_as_curator¶
object update_preparation_as_curator(id, body=body)
Update a preparation object
Basic operation¶
The object metadata is updated using the supplied map of attribute names to attribute values. There are three cases:
1. The attribute name does not already exist in the object metadata. In this case, the attribute and value are added to the object metadata.
2. The attribute name already exists in the object metadata. In this case, the value is updated.
3. The attribute value is null.In this case, the attribute is removed from the object metadata.
Attribute values¶
The attribute values are intelligently parsed as booleans, integers, etc.
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.PreparationSPoTAsCuratorApi(api_client)
id = 'id_example' # str | Unique identifier (accession) of the object.
body = None # object | Metadata in the form of `{key: value, key2: value2, ...}` (optional)
try:
# Update a preparation object
api_response = api_instance.update_preparation_as_curator(id, body=body)
print("The response of PreparationSPoTAsCuratorApi->update_preparation_as_curator:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PreparationSPoTAsCuratorApi->update_preparation_as_curator: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Unique identifier (accession) of the object. | |
| body | object | Metadata in the form of `{key: value, key2: value2, ...}` | [optional] |
Return type¶
object
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 objects was successfully created. The returned value is the updated object, along with any warnings. | - |
| 400 | The supplied object ID or metadata is invalid. | - |
| 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]