clientSecret = ""
appSessionId = ""
apiServer = "https://api.basespace.illumina.com/"  # or 'https://api.cloud-hoth.illumina.com/'
apiVersion = "v1pre3"

# First we will initialize a BaseSpace API object using our app information and the appSessionId
if clientKey:
    myAPI = BaseSpaceAPI(clientKey, clientSecret, apiServer, apiVersion, appSessionId)
else:
    myAPI = BaseSpaceAPI(profile="DEFAULT")


# Now we'll do some work of our own. First get a project to work on
# we'll need write permission, for the project we are working on
# meaning we will need get a new token and instantiate a new BaseSpaceAPI
p = myAPI.getProjectById("89")

# Assuming we have write access to the project
# we will list the current App Results for the project
appRes = p.getAppResults(myAPI, statuses=["Running"])
print "\nThe current running AppResults are \n" + str(appRes)

# now let's do some work!
# to create an appResults for a project, simply give the name and description
appResults = p.createAppResult(myAPI, "testing", "this is my results", appSessionId="")
print "\nSome info about our new app results"
print appResults
print appResults.Id
print "\nThe app results also comes with a reference to our AppSession"
myAppSession = appResults.AppSession
print myAppSession
AppSessionId               = ""
accessToken                = ""
# test if client variables have been set
helper.checkClientVars({'client_key':client_key,'client_secret':client_secret,'AppSessionId':AppSessionId}) 

BaseSpaceUrl               = 'https://api.basespace.illumina.com'
version                    = 'v1pre3'

# First, create a client for making calls for this user session 
myBaseSpaceAPI   = BaseSpaceAPI(client_key, client_secret, BaseSpaceUrl, version, AppSessionId,AccessToken=accessToken)


# Now we'll do some work of our own. First get a project to work on
# we'll need write permission, for the project we are working on
# meaning we will need get a new token and instantiate a new BaseSpaceAPI  
p = myBaseSpaceAPI.getProjectById('89')

# Assuming we have write access to the project
# we will list the current App Results for the project 
appRes = p.getAppResults(myBaseSpaceAPI,statuses=['Running'])
print "\nThe current running AppResults are \n" + str(appRes)

# now let's do some work!
# to create an appResults for a project, simply give the name and description
appResults = p.createAppResult(myBaseSpaceAPI,"testing","this is my results",appSessionId='')
print "\nSome info about our new app results"
print appResults
print appResults.Id
print "\nThe app results also comes with a reference to our AppSession"
myAppSession = appResults.AppSession
print myAppSession
Esempio n. 3
0
clientSecret = ""
appSessionId = ""
apiServer = 'https://api.basespace.illumina.com/'  # or 'https://api.cloud-hoth.illumina.com/'
apiVersion = 'v1pre3'

# First we will initialize a BaseSpace API object using our app information and the appSessionId
if clientKey:
    myAPI = BaseSpaceAPI(clientKey, clientSecret, apiServer, apiVersion,
                         appSessionId)
else:
    myAPI = BaseSpaceAPI(profile='DEFAULT')

# Now we'll do some work of our own. First get a project to work on
# we'll need write permission, for the project we are working on
# meaning we will need get a new token and instantiate a new BaseSpaceAPI
p = myAPI.getProjectById('89')

# Assuming we have write access to the project
# we will list the current App Results for the project
appRes = p.getAppResults(myAPI, statuses=['Running'])
print("\nThe current running AppResults are \n" + str(appRes))

# now let's do some work!
# to create an appResults for a project, simply give the name and description
appResults = p.createAppResult(myAPI,
                               "testing",
                               "this is my results",
                               appSessionId='')
print("\nSome info about our new app results")
print(appResults)
print(appResults.Id)