added doc for parameters

Signed-off-by: Alkivi <anthony@alkivi.fr>
This commit is contained in:
Alkivi 2015-06-16 12:48:09 +02:00
parent 3e90003343
commit 24bb4ba318
2 changed files with 55 additions and 1 deletions

View file

@ -186,7 +186,7 @@ is only supported with reserved keywords.
# Create a new alias
client.post('/email/domain/%s/redirection' % DOMAIN,
_from=SOURCE,
to=DESTINATION
to=DESTINATION,
localCopy=False
)
print "Installed new mail redirection from %s to %s" % (SOURCE, DESTINATION)
@ -371,6 +371,33 @@ The client will successively attempt to locate this configuration file in
This lookup mechanism makes it easy to overload credentials for a specific
project or user.
Passing parameters
=============
You can call all the methods of the API with the necessary arguments.
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``.
With characters invalid in python argument name like a dot, you can:
.. code:: python
# -*- encoding: utf-8 -*-
import ovh
params = {}
params['date.from'] = '2014-01-01'
params['date.to'] = '2015-01-01'
# create a client
client = ovh.Client()
# pass parameters using **
client.post('/me/bills', **params)
Hacking
=======

View file

@ -363,6 +363,33 @@ The client will successively attempt to locate this configuration file in
This lookup mechanism makes it easy to overload credentials for a specific
project or user.
Passing parameters
=============
You can call all the methods of the API with the necessary arguments.
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``.
With characters invalid in python argument name like a dot, you can:
.. code:: python
# -*- encoding: utf-8 -*-
import ovh
params = {}
params['date.from'] = '2014-01-01'
params['date.to'] = '2015-01-01'
# create a client
client = ovh.Client()
# pass parameters using **
client.post('/me/bills', **params)
Hacking
=======