Repository navigation
Highlights
- The async client reuses connections. Use
async with AIOCloudStack(...) as cs:and every call shares one HTTP session. You can also pass an existingaiohttp.ClientSessionassession=, which is left open. The async client now supportstrace,retryandjson=False, like the sync client. - The sync client keeps its connections alive. It used to close its session after every request.
- Retries back off. Retries of
listandqueryAsynccalls waitretry_backoffseconds (default 0.5) before the first attempt. The wait doubles on each further attempt, up to 30 seconds. - Type hints. The package now ships type hints and a
py.typedmarker.
Fixes
- Boolean settings read from the environment were not converted, so
CLOUDSTACK_TRACE=falseandCLOUDSTACK_DANGEROUS_NO_TLS_VERIFY=falsewere treated as true. fetch_list=Trueno longer loops forever on an empty page.- Lists of numbers, floats and booleans are now accepted as parameters. Sets are sent in a stable order.
- A response without exactly one top-level key now raises
CloudStackExceptioninstead ofValueError. python -m csnow exits with a non-zero status on errors. Error messages are no longer printed twice.- The CLI only strips one pair of matching quotes around a value, so
name=it'sstays intact. hasattr(),copyandpickleno longer treat private attribute names as API commands.- The async client sends the call's headers while polling a job, and no longer fails when a response has no
Content-Typeheader. job_timeoutis measured with a monotonic clock, so system clock changes don't affect it.
New settings
retry_backoff/CLOUDSTACK_RETRY_BACKOFFjob_timeout/CLOUDSTACK_JOB_TIMEOUTcan now be set in the config file and the environment. Before, it could only be passed in Python.
Behavior changes
- Booleans are sent as
true/falseinstead ofTrue/False. CloudStack accepts both. - Headers passed to a single call now override the client's
headersfor the same name. - Retries wait before resending. Set
retry_backoff=0to retry immediately as before. tzdatais no longer a dependency.
What's Changed
- Client fixes, async session reuse, retry backoff and type hints by @resmo in #177
- chore: Configure Renovate by @renovate[bot] in #168
- Dependency and CI updates by @dependabot[bot]: #162, #163, #164, #165, #166, #167, #170, #171, #172, #173, #174, #175, #176
Full Changelog: v5.1.0...v5.2.0