[Iplant-api-dev] Agave SDK for Python
Joe Stubbs
jstubbs at tacc.utexas.edu
Mon Jan 27 08:55:31 MST 2014
There is an issue in the SDK. It's not setting the Authorization header
correctly. It's using the apiKey on the ApiClient instance to set a
header called 'Api_key', but it needs to set the Auth header with value
in the format "Bearer <token>". We'll look into getting a fix in the
repo soon.
We're sorry for the frustration.
Joe
On 01/24/2014 11:23 PM, Rion Dooley wrote:
> I'll ask our python guru to check it out. The SDK is for Python 2.
>
> Rion
> ________________________________________
> From: Darren Boss [dboss at email.arizona.edu]
> Sent: Friday, January 24, 2014 11:15 PM
> To: Rion Dooley
> Cc: Discussion of iPlant API development
> Subject: Re: [Iplant-api-dev] Agave SDK for Python
>
> Here is the code that I assumed would get me a list of apps but I'm
> only getting an exception (HTTP Error 500). I'm able to get the app
> list using the curl command "curl -sk -H "Authorization: Bearer
> ea8e39f649ddfb89d5a13a629d4f51" https://agave.iplantc.org/apps/2.0". I
> also renamed the agave-sdk-python to agave otherwise I can't import it
> (modules with hyphens in Python are problematic):
>
> from agave import *
>
> apiClient = agave.ApiClient('ea8e39f649ddfb89d5a13a629d4f51',
> 'https://agave.iplantc.org/')
> appsService = AppsApi.AppsApi(apiClient)
> response = appsService.listApplication()
>
> Has someone tested the generated Python Api to make sure it works and
> with what version of Python?
>
> On Fri, Jan 24, 2014 at 12:57 PM, Darren Boss <dboss at email.arizona.edu> wrote:
>> Cool, that's what I was starting to think. I'll take a look at using
>> rauth together with the sdk. I'll probably email back with more
>> questions shortly.
>>
>> On Fri, Jan 24, 2014 at 12:45 PM, Rion Dooley <dooley at tacc.utexas.edu> wrote:
>>> The process for obtaining a token is intentionally left out. Agave uses OAuth2 and there are quite a few open source libraries in multiple languages that handle that interaction for you. Rather than reinvent the wheel, we leave it to you to use whichever library and oauth flow suites your needs.
>>>
>>> If you just need to get a token quickly to kick things around, you can go to http://agaveapi.co/live-docs and click the login button. It will walk the oauth flow for you and put a token in the input box next to the button. That is also a good example of how you could add a "login with iPlant" feature to a website.
>>>
>>> Rion
>>>
>>> ________________________________________
>>> From: iplant-api-dev-bounces at iplantcollaborative.org [iplant-api-dev-bounces at iplantcollaborative.org] on behalf of Darren Boss [dboss at email.arizona.edu]
>>> Sent: Friday, January 24, 2014 11:27 AM
>>> To: Rion Dooley
>>> Cc: Discussion of iPlant API development
>>> Subject: [Iplant-api-dev] Agave SDK for Python
>>>
>>> I recently checked out the api for Python from
>>> https://bitbucket.org/taccaci/agave-sdk-python. I have a question
>>> about using the api in a Python project. It appears there is nothing
>>> in the api for dealing with tokens and the one example just has the
>>> token listed in a variable (the code sample for that is actually
>>> Perl). Has anyone used the python sdk yet? I'm just trying to use it
>>> in ipython right now. Do I need to create my own classes for dealing
>>> with tokens?
>>>
>>> If anyone else gives it a try make sure to rename the checked out
>>> directory so there are no hyphens otherwise you can't use it in an
>>> import statement.
>>>
>>> Any calls that hit the server are just returning error 500.
>>> _______________________________________________
>>> Iplant-api-dev Mailing List: Iplant-api-dev at iplantcollaborative.org
>>> List Info and Archives: http://mail.iplantcollaborative.org/mailman/listinfo/iplant-api-dev
>>> One-click Unsubscribe: http://mail.iplantcollaborative.org/mailman/options/iplant-api-dev/dooley%40tacc.utexas.edu?unsub=1&unsubconfirm=1
> _______________________________________________
> Iplant-api-dev Mailing List: Iplant-api-dev at iplantcollaborative.org
> List Info and Archives: http://mail.iplantcollaborative.org/mailman/listinfo/iplant-api-dev
> One-click Unsubscribe: http://mail.iplantcollaborative.org/mailman/options/iplant-api-dev/jstubbs%40tacc.utexas.edu?unsub=1&unsubconfirm=1
More information about the Iplant-api-dev
mailing list