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
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.
To unsubscribe from this group and stop receiving emails from it, send an email to basespace-developers+unsub...@googlegroups.com.