Basic basespace-python-sdk trouble

156 views
Skip to first unread message

David Berg

unread,
Jan 14, 2019, 9:57:22 AM1/14/19
to basespace-developers

I’m struggling to get started with the python SDK.  I was eventually able to get running, connected, and credentialled valid data is returned.  However, I’m getting permission errors I don’t expect.

 

If I try to request a new verification code I get certificate errors from pycurl. 

 

Ultimately, I’m trying to write a simple native app that will create a project and upload fastqs to new samples in the project (using bs).

Then trigger the a “Whole Genome Sequencing” App.

Then when the triggered app has finished, (likely a third app will) download the results.

 

I’m currently investigating the best way to accomplish the second and third portions.

 

Can you help me proceed?

 

 

********************************************************

from BaseSpacePy.api.BaseSpaceAPI import BaseSpaceAPI

client_id =
'***'
client_secret = '***'
access_token = '***'
project_id = '111639528'
sample_id = '150986836'
api_server = "https://api.basespace.illumina.com/"
version = 'v1pre3'

api = BaseSpaceAPI(
  
clientKey=client_id,
  
clientSecret=client_secret,
  
AccessToken=access_token,
  
apiServer=api_server,
  
version=version,
)

api.getProjectById(project_id)

s = api.getSampleFilesById(sample_id)
print(s)

*********************

C:\Users\m106093\IdeaProjects\basespace-python-sdk\venv\Scripts\python.exe C:/Users/m106093/IdeaProjects/basespace-python-sdk/basespace_workflow.py

Traceback (most recent call last):

  File "C:/Users/m106093/IdeaProjects/basespace-python-sdk/basespace_workflow.py", line 21, in <module>

    s = api.getSampleFilesById(sample_id)

  File "C:\Users\m106093\IdeaProjects\basespace-python-sdk\src\BaseSpacePy\api\BaseSpaceAPI.py", line 764, in getSampleFilesById

    resourcePath, method, queryParams, headerParams)

  File "C:\Users\m106093\IdeaProjects\basespace-python-sdk\src\BaseSpacePy\api\BaseAPI.py", line 112, in __listRequest__

    raise ServerResponseException(str(response['ResponseStatus']['ErrorCode'] + ": " + response['ResponseStatus']['Message']))

BaseSpacePy.api.BaseSpaceException.ServerResponseException: 'Error with API server response: BASESPACE.COMMON.INSUFFICIENT_RESOURCE_PERMISSIONS: Sorry but this requires BROWSE access to this Sample resource.'

 

Process finished with exit code 1

 

 

 

********************************************************

from BaseSpacePy.api.BaseSpaceAPI import BaseSpaceAPI

client_id =
'***'
client_secret = '***'
access_token = '***'
project_id = '111639528'
sample_id = '150986836'
api_server = "https://api.basespace.illumina.com/"
version = 'v1pre3'

api = BaseSpaceAPI(
  
clientKey=client_id,
  
clientSecret=client_secret,
  
apiServer=api_server,
  
version=version,
)

response = api.getVerificationCode(
'browse global')

*********************

C:\Users\m106093\IdeaProjects\basespace-python-sdk\venv\Scripts\python.exe C:/Users/m106093/IdeaProjects/basespace-python-sdk/basespace_workflow.py

Traceback (most recent call last):

  File "C:/Users/m106093/IdeaProjects/basespace-python-sdk/basespace_workflow.py", line 21, in <module>

    response = api.getVerificationCode('browse global')

  File "C:\Users\m106093\IdeaProjects\basespace-python-sdk\src\BaseSpacePy\api\BaseSpaceAPI.py", line 376, in getVerificationCode

    return self.__makeCurlRequest__(data, self.apiClient.apiServerAndVersion + deviceURL)

  File "C:\Users\m106093\IdeaProjects\basespace-python-sdk\src\BaseSpacePy\api\BaseAPI.py", line 138, in __makeCurlRequest__

    c.perform()

pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

 

Process finished with exit code 1

********************************************************

 

 

 

David R. Berg | Information Technology | IT SR Analyst/Programmer 

Mayo Clinic | 200 First Street SW | Rochester, MN 55905 |mayoclinic.org

 

David Berg

unread,
Jan 16, 2019, 12:58:46 PM1/16/19
to basespace-developers
Any help with this?

Peter Saffrey

unread,
Feb 1, 2019, 8:46:07 AM2/1/19
to basespace-developers
Hi David,

Really sorry for the slow response here.

The BaseSpace Python SDK has not been properly supported for a good while now and much of the content in there is outdated or potentially broken. At the moment, we do not have a well-supported SDK for BaseSpace - I would probably recommend BSCLI as the best way to perform the type of automation you're describing.

Sorry about this,

Peter

Berg, David R. (Dave), M.S.

unread,
Feb 5, 2019, 2:07:17 PM2/5/19
to basespace-developers on behalf of Peter Saffrey

Good to know.  It would be helpful to have that information listed on the documentation pages. 

 

If we need to pull data that the CLI doesn’t access, we’ll then need to access the API directly or write our own SDK?

--
You received this message because you are subscribed to the Google Groups "basespace-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to basespace-develo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Saffrey

unread,
Feb 6, 2019, 6:12:48 AM2/6/19
to basespace-developers
I quite agree about the documentation. I will chase that again.

Which data do you need that is not available through CLI? I think we to provide access to everything that might be useful, so we should probably add it.

Thanks,

Peter

To unsubscribe from this group and stop receiving emails from it, send an email to basespace-developers+unsub...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages