ovh / python-ovh

Thin wrapper around OVH's APIs. Handles all the hard work including credential creation and requests signing.
https://pypi.org/project/ovh/
Other
278 stars 76 forks source link

Get cloud/project/{serviceName}/bill impossible in python3 ? #78

Closed thomasdebugger closed 5 years ago

thomasdebugger commented 5 years ago

I'm using Python3 and i try to get the bill for the projects with this reqest :

client = ovh.Client( endpoint='ovh-eu',
application_key='****',
application_secret='****',
consumer_key='**',
)

result = client.get('/cloud/project/'+ projectId+'/bill',from=d1,to=d2)

and i have a synthax error

ps: ProjectId is existing (i have checking with the api console) and d1='2019-01-01' d2='2019-06-06'

what's wrong ? I do a lot of auther request and they don't failled...

geoffreybauduin commented 5 years ago

Hello,

the documentation (https://pypi.org/project/ovh/) states the following:

If an API needs an argument colliding with a Python reserved keyword, it can be prefixed with an underscore. For example, from argument of POST /email/domain/{domain}/redirection may be replaced by _from.

I suggest you change the from parameter to _from

rbeuque74 commented 5 years ago

Looks like @geoffreybauduin got your issue. Feel free to reopen if needed.