- Unified query behaviour of all API classes (introducing potentially breaking changes as the order of parameters needed to change).
- Added support for arbitrary expressions and kwargs on almost all select functions defined at the API classes, e.g. for Measurements, Events, Alarms, Inventory, etc. Using the expression parameter (always the first in all select-like functions that support it), an arbitrary query expression can be defined which will be forwarded to the REST API as-is. Using kwargs, additional maybe undocumented or deprecated parameters can be defined.
- Additional, undocumented select parameters will automatically be converted to Pascal case (e.g. my_undocumented_arg will be translated to myUndocumentedArg).
- Incorporated pull request to remove dependency on deprecated pkg_resources package (thanks @reubenmiller).
- Incorporated pull request to support context handlers.
- Many additional unit tests and integration tests.
- Fixed issue #63 (tenant option select function did not filter categories correctly).
- Added support for processing mode on all API base classes
- Added support for Cookie-based auth on OAI-only tenants
- Added latest extensions for Notification 2.0 API including
count
function. - Switch to Python version 3.10
- Added Changes support to the Audit API.
- Fixed Issue #53 "KeyError when retrieving 'bulkOperation'"; bulk operations JSON is somewhat non-standard as the root element is not named like the corresponding REST resource.
- Added proper support for the CurrentUser API; this is a breaking change as some functions moved from the User API to the CurrentUser API (the correct place).
- Added support for 2FA at user level; TFA/TOTP can be enabled for individual users. Parts of this functionality, e.g. getting the TOTP secret are only available at the CurrentUser level
- Adding traditional date filter parameter names (date_from and date_to in addition to before/after) to Events and Alarms API.
- The
select
andget_all
functions now feature anexpression
parameter which allows to directly specify the entire REST API filtering expression. - Fixed, unified and streamlined the behavior or the
query
parameter within allselect
andget_all
functions. - The
apply_to
functions now allow to specify the to-be-applied changes directly in JSON. - Various tiny code and documentation improvements.
- Updated GitHub Actions to latest Node versions.
- Fixed build dependencies.
- Testing code improvements.
- Added support for signed, shared and non-persistent Notification 2.0 subscriptions and tokens (Thanks @wilbersl!)
- Fixed audit record parsing.
- Various code and documentation improvements.
- Added support for token-based authentication for interactive sessions.
- Added page_number parameter to inventory queries to be able to pull a specific page.
- Added get_count functions to inventory to estimate expected number of results.
- Added get_subscribers function MultiTenantCumulocityApp.
- Minor improvements and fixes.
- Added possibility to pull a specific result page to all
select
andget_all
functions.
-
Added support for inventory endpoints
/availability
,/supportedMeasurements
and/supportedSeries
. -
Added
Units
class to support explicit modelling of measurement fragments. -
Added support for the Current Application API (current application settings, current application subscriptions).
-
Added test fixture (
app_factory
)toconftest.py
to register (and automatically unregister) a dedicated microservice application for advanced integration testing. -
Making websocket ping interval explicit and updating it to 60 seconds by default.
-
Bumped flask from 2.2.2 to 2.3.2 (vulnerability)
Bumped python-dateutil from 2.8.1 to 2.8.2 (pandas requirement)
-
Added
is_tls
property toCumulocityRestApi
class;fixed secure protocol handling for Notification2 websocket connections.
-
Microservice build support improvements.
- Fixed series value collection for incomplete series.
- Adding support for measurement series queries.
-
Adding support for the Audit API.
-
Added support for event attachment handling.
-
Adding support for bulk operations.
- Adding
c8y_tk
namespace to distribution.
-
Added API support for Notification 2.0 subscriptions and tokens.
-
Added new package c8y_tk for additional features.
-
Added synchronous and asynchronous Notification 2.0 websocket listener, Added two (async/sync) Notification 2.0 samples.
-
Improved Applications API.
-
Added microservice utilities for easier testing of provided samples.
-
Added Tenant Options API support.
-
Fixed #25 The SimpleTenantApp did not include the tenant ID into the username which is not supported by all Cumulocity instances.
-
Adding class _QueryUtil, bundling query encoding related functionality.
-
Added tests for special character parsing.
-
Fixed handling and documentation of inventory API for querying by name. Added query parameter for specification of custom queries.
-
Reverted changes in ComplexObject - a ComplexObject is not a dictionary-like class, it only
supports some dictionary-like access functions. But, for instance, updating a ComplexObject is very different from updating a dictionary. Hence, it no longer inherits MutableMapping.
-
Obfuscated internal properties in _DictWrapper which blocked standard dictionary behavior. Code cleanup.
-
ComplexObject & _DictMapping now both inherit MutableMapping (Thanks Sam!).
-
The base API now ignores trailing slashes gracefully.
- Switched to version 2.4.0 of PyJWT as recommended by https://nvd.nist.gov/vuln/detail/CVE-2022-29217
- All objects with fragments can now be converted to Pandas Series (Thanks Sam!).
-
Added support for operations (Thanks Alex!).
-
Added support for lastUpdated field in alarms and events.
-
Changed behavior of Events and Alarms API. Previously, an undefined event/alarm time was set to the current datetime when invoking the
.create
function on the object. This was handy but inconsistent to the REST API behavior and therefore removed. Instead, the constructor can now be invoked withtime='now'
as a shorthand. Thetime
field is never set to a default value automatically. -
Added
samples
folder to linting task. -
Added device agent registration sample (Thanks Nick!).
-
Added Multi-Tenant sample script (
samples/multi_tenant_app.py
). -
Added task
build-ms
task and corresponding script files to generate Cumulocity microservices from sample scripts.
-
Fixed authentication (username must include tenant ID) for subscribed tenants in multi-tenant scenarios.
-
Fixed pylint dependency in
requirements.txt
. -
Added
cachetools
to library dependencies insetup.cfg
.
-
Warning, this release is a breaking change as it introduces an
auth
parameter to the API base classes,CumulocityRestAPI
andCumulocityAPI
. This parameter should be the new standard to use (instead of just username and password). -
Warning, this release replaces the 'all-purpose' class
CumulocityApp
with specialized versions for multi-tenant (MultiTenantCumulocityApp
) and single tenant (SimpleCumulocityApp
) environments.
-
Added
_util.py
file to hold all cross-class auxiliary functionality. -
Added
_auth.py
file to hold all cross-class authentication functionality. Moved corresponding code from fileapp.__init__.py
to theAuthUtil
class. -
Added
_jwt.py
withJWT
class which encapsulates JWT handling for the libraries purpose. This is not a full JWT implementation. -
Added
HTMLBearerAuth
class which encapsulates Cumulocity's JWT token-based authentication mechanism. -
Added token-based authentication support. All API classes now can be initialized with an AuthBase parameter which would allow all kinds of authentication mechanisms. As of now,
HTTPbasicAuth
andHTTPBearerAuth
is supported. -
Added caching with TTL/Max Size strategies to
MultiTenantCumulocityApp
andSimpleCumulocityApp
. -
Added samples:
user_sessions.py
illustrating how user sessions can be obtained andsimple_tenant_app.py
illustrating how theSimpleCumulocityApp
class is used. -
Added requirements:
cachetools
(for caching),inputtimeout
andflask
(for samples).
-
Fixed file opening in
post_file
function in_base_api.py
to avoid files already being closed when posting. -
Removed class
CumulocityApp
as it was too generic and hard to use. Replaces with classesSimpleCumulocityApp
which behaves pretty much identical andMultiTenantCumulocityApp
which behances more like a factory.
-
Added this changelog :-)
-
Fixed Issue #7: Improved caching and user experience when creating CumulocityApp instances. Added unit tests.
-
Added possibility to resolve the tenant ID from authorization headers (both
Basic
andBearer
).
- The cumulocity-pyton-api library is now available on PyPI under the name
c8y_api
(see https://pypi.org/project/c8y-api/) - Updated README to reflect installation from PyPI
Major refactoring of beta version:
- Unified user experience
- Complete documentation
- Performance improvements
- Introduced
CumulocityApp
to avoid mix-up withCumulocityApi
- Complete unit tests
- Structured integration tests
- Removed samples (sorry, need to be re-organized)