scripts/arbitrary_sm.py
def run_sm(
    api_name: str, method_name: str, args: List[str] = None, kwargs: dict = None
):
    """
    Use the sample metadata API based on:
    :param api_name: pure name of API, eg: 'analysis'
    :param method_name: name of method in snake case
    :param args: positional args of endpoint
    :param kwargs: keyword arguments of endpoint, note:
        POST requests have funny kwarg names, eg:
        'body_get_samples_by_criteria_api_v1_sample_post'
    """
    api_class_name = api_name.title() + 'Api'
    api = getattr(sample_metadata.api, api_class_name)
    api_instance = api()
    response = getattr(api_instance, method_name)(*(args or []), **(kwargs or {}))

    return response

    Use the sample metadata API based on:
    :param api_name: pure name of API, eg: 'analysis'
    :param method_name: name of method in snake case
    :param args: positional args of endpoint
    :param kwargs: keyword arguments of endpoint, note:
        POST requests have funny kwarg names, eg:
        'body_get_samples_by_criteria_api_v1_sample_post'
    
Use the sample metadata API based on.
Use the sample metadata API based on .
def run_sm(
    api_name: str, method_name: str, args: List[str] = None, kwargs: dict = None
):
    api_class_name = api_name.title() + 'Api'
    api = getattr(sample_metadata.api, api_class_name)
    api_instance = api()
    response = getattr(api_instance, method_name)(*(args or []), **(kwargs or {}))
    return response
def run_sm ( api_name : str , method_name : str , args : List [ str ] = None , kwargs : dict = None ) : api_class_name = api_name . title ( ) + 'Api' api = getattr ( sample_metadata . api , api_class_name ) api_instance = api ( ) response = getattr ( api_instance , method_name ) ( * ( args or [ ] ) , ** ( kwargs or { } ) ) return response
Use the sample metadata API based on:
Use the sample metadata API based on :
"""
    Use the sample metadata API based on:
    :param api_name: pure name of API, eg: 'analysis'
    :param method_name: name of method in snake case
    :param args: positional args of endpoint
    :param kwargs: keyword arguments of endpoint, note:
        POST requests have funny kwarg names, eg:
        'body_get_samples_by_criteria_api_v1_sample_post'
    """
api_name
str
pure name of API, eg: 'analysis'
pure name of API eg : ' analysis '
method_name
str
name of method in snake case
name of method in snake case
args
List[str]
positional args of endpoint
positional args of endpoint
kwargs
dict
keyword arguments of endpoint, note:
POST requests have funny kwarg names, eg:
'body_get_samples_by_criteria_api_v1_sample_post'
keyword arguments of endpoint note : POST requests have funny kwarg names eg : ' body_get_samples_by_criteria_api_v1_sample_post '