示例#1
0
def get(id, destination):
    """Get details of data"""
    api = rest.DataApi(configuration.get_api_client())
    if destination is None:
        result = api.get_data(id)
        pprint.pp_dict(util.to_dict(result))
    else:
        with util.release_conn(api.get_data(id, _preload_content=False)) as result:
            logging.info('open %s', destination)
            with open(destination, 'wb') as f:
                logging.info('begin io %s', destination)
                f.write(result.data)
                logging.info('end io %s', destination)
        print('save', id, 'as', destination)
示例#2
0
def get(id):
    """Get details of training"""
    api = rest.TrainingApi(configuration.get_api_client())
    result = api.get_training(id)
    pprint.pp_dict(util.to_dict(result))
示例#3
0
def get(id):
    """Get details of inference"""
    api = rest.InferenceApi(configuration.get_api_client())
    result = api.get_inference(id)
    pprint.pp_dict(util.to_dict(result))
示例#4
0
def delete(id):
    """Delete a tenant"""
    api = rest.TenantApi(configuration.get_api_client())
    result = api.delete_tenant(id)
    print('deleted', id)
    pprint.pp_dict(util.to_dict(result))
示例#5
0
def get(id):
    """Get details of a tenant"""
    api = rest.TenantApi(configuration.get_api_client())
    result = api.get_tenant(id)
    pprint.pp_dict(util.to_dict(result))
示例#6
0
def get(id):
    """Get details of data"""
    api = rest.DataApi(configuration.get_api_client())
    result = api.get_data(id)
    pprint.pp_dict(util.to_dict(result))