Commit Graph

8 Commits

Author SHA1 Message Date
David Moreau Simard 0614e3c9f5
Update README to explain ara-clients was migrated back into ara
The ara-clients standalone repository is being discontinued.
The clear and logical separation of components was nice but the overhead
in complexity was not worth it.

Change-Id: I345dfa25c049d7e3874a8f502156c857df44c734
2019-03-02 08:48:10 -05:00
David Moreau Simard 051c4c92de
Fix usage of GET requests with query parameters
Python requests accepts GET query parameters (?foo=bar&bar=foo) inside
the "params" key of the request.

Change-Id: Ia493819c48ec907bb6fb9454dea95e4fe62ef03a
2018-12-18 11:28:46 -05:00
David Moreau Simard 6597aff444
Use 'ara-clients' instead of __name__ when determining client version
This resolves an exception by pbr when Ansible attempts to load the
client:
"""
Versioning for this project requires either an sdist tarball,
or access to an upstream git repository. It's also possible that
there is a mismatch between the package name in setup.cfg and
the argument given to pbr.version.VersionInfo. Project name
ara.clients.http was given, but was not able to be found.
"""

Change-Id: Id56bf0909d17259313307d433a6104fe02e0215e
2018-12-14 12:30:13 -05:00
David Moreau Simard 1e1fd3a4be
Remove debug line before initiating request
The debug log are already a bit chatty, we don't need this particular
line because we're getting the result right after with another debug
line.

Change-Id: I1d60f90cae9db896d4bceaf3f7211597ad8242f3
2018-11-14 14:19:55 -05:00
David Moreau Simard b1dc3a0944
Run black/isort on ara-clients
There will be a follow up patch to add black/isort CI.

Change-Id: I8f16ad01d9a7c986b12a543ff351cbf17a0df70d
2018-10-02 16:44:24 -05:00
David Moreau Simard 1e873cf9c9
Add version of the http agent to the user agent string
Change-Id: I61e85899be88788edc9091dd81f7cef3e8fa94a0
2018-09-20 14:01:47 -04:00
David Moreau Simard 96489515ac
Streamline how payloads are passed back and forth in the http client
- Set default headers through requests.session
- Set timeout explicitely
- GET parameters need to be passed as "params"
- Don't send empty GET parameters
- POST/PUT/PATCH parameters need to be passed as "data"
- DELETE doesn't expect any parameters

Change-Id: Icc1d821501a160be10975333accc6b791b6f058f
2018-09-20 14:00:10 -04:00
David Moreau Simard ee86bb5cfe
Add first iteration of http client
The offline client is ideal for running offline and locally.
The http client uses requests to do actual http requests to an API
server.

Change-Id: I2b1ed6068ab547d55237b3f9ff7150935232caa6
2018-09-12 10:45:26 -04:00