![]() |
ctrlX Data Layer API for Python
3.3.0
The ctrlX Data Layer API allows access to the ctrlX Data Layer with Python
|
Public Member Functions | |
def | __init__ (self, C_DLR_CLIENT c_client) |
def | __enter__ (self) |
def | __exit__ (self, exc_type, exc_val, exc_tb) |
Result | browse_async (self, str address, ResponseCallback cb, userData_c_void_p userdata=None) |
def | browse_sync (self, str address) |
def | close (self) |
Result | create_async (self, str address, Variant data, ResponseCallback cb, userData_c_void_p userdata=None) |
def | create_bulk (self) |
def | create_subscription_async (self, Variant prop, ctrlxdatalayer.subscription.ResponseNotifyCallback cnb, ResponseCallback cb, userData_c_void_p userdata=None) |
def | create_subscription_sync (self, Variant prop, ctrlxdatalayer.subscription.ResponseNotifyCallback cnb, userData_c_void_p userdata=None) |
def | create_sync (self, str address, Variant data) |
str | get_auth_token (self) |
def | get_handle (self) |
def | get_token (self) |
bool | is_connected (self) |
Result | metadata_async (self, str address, ResponseCallback cb, userData_c_void_p userdata=None) |
def | metadata_sync (self, str address) |
Result | ping_async (self, ResponseCallback cb, userData_c_void_p userdata=None) |
Result | ping_sync (self) |
Result | read_async (self, str address, ResponseCallback cb, userData_c_void_p userdata=None) |
Result | read_async_args (self, str address, Variant args, ResponseCallback cb, userData_c_void_p userdata=None) |
def | read_json_sync (self, Converter conv, str address, int indent, Variant data=None) |
def | read_sync (self, str address) |
def | read_sync_args (self, str address, Variant args) |
Result | remove_async (self, str address, ResponseCallback cb, userData_c_void_p userdata=None) |
Result | remove_sync (self, str address) |
def | set_auth_token (self, str token) |
Result | set_timeout (self, TimeoutSetting timeout, int value) |
Result | write_async (self, str address, Variant data, ResponseCallback cb, userData_c_void_p userdata=None) |
def | write_json_sync (self, Converter conv, str address, str json) |
def | write_sync (self, str address, Variant data) |
Client interface for accessing data from the system.
Hint see python context manager for instance handling
def __init__ | ( | self, | |
C_DLR_CLIENT | c_client | ||
) |
[in] | client | Reference to the client |
Definition at line 68 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Client.__token.
Result browse_async | ( | self, | |
str | address, | ||
ResponseCallback | cb, | ||
userData_c_void_p | userdata = None |
||
) |
Browse an object.
This function is asynchronous. It will return immediately. Callback will be called if function call is finished. Result data may be provided in callback function.
[in] | address | Address of the node to browse |
[in] | callback | Callback to call when function is finished |
[in] | userdata | User data - will be returned in callback as userdata. You can use this userdata to identify your request |
Definition at line 337 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, ProviderNode.__create_callback(), Client.__create_callback(), and Client.__token.
def browse_sync | ( | self, | |
str | address | ||
) |
Browse an object.
This function is synchronous: It will wait for the answer.
[in] | address | Address of the node to browse |
Definition at line 227 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.
Result create_async | ( | self, | |
str | address, | ||
Variant | data, | ||
ResponseCallback | cb, | ||
userData_c_void_p | userdata = None |
||
) |
Create an object.
This function is asynchronous. It will return immediately. Callback will be called if function call is finished. Result data may be provided in callback function.
[in] | address | Address of the node to create object in |
[in] | data | Data of the object |
[in] | callback | Callback to call when function is finished |
[in] | userdata | User data - will be returned in callback as userdata. You can use this userdata to identify your request |
Definition at line 305 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, ProviderNode.__create_callback(), Client.__create_callback(), and Client.__token.
def create_bulk | ( | self | ) |
def create_subscription_async | ( | self, | |
Variant | prop, | ||
ctrlxdatalayer.subscription.ResponseNotifyCallback | cnb, | ||
ResponseCallback | cb, | ||
userData_c_void_p | userdata = None |
||
) |
Set up a subscription.
[in] | ruleset | Variant that describe ruleset of subscription as subscription.fbs |
[in] | publishCallback | Callback to call when new data is available |
[in] | userdata | User data - will be returned in publishCallback as userdata. You can use this userdata to identify your subscription |
def create_subscription_sync | ( | self, | |
Variant | prop, | ||
ctrlxdatalayer.subscription.ResponseNotifyCallback | cnb, | ||
userData_c_void_p | userdata = None |
||
) |
Set up a subscription.
[in] | ruleset | Variant that describe ruleset of subscription as subscription.fbs |
[in] | publishCallback | Callback to call when new data is available |
[in] | userdata | User data - will be returned in publishCallback as userdata. You can use this userdata to identify your subscription |
def create_sync | ( | self, | |
str | address, | ||
Variant | data | ||
) |
Create an object.
This function is synchronous: It will wait for the answer.
[in] | address | Address of the node to create object in |
[in] | variant | Data of the object |
Definition at line 204 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.
str get_auth_token | ( | self | ) |
returns persistent security access token for authentication
Definition at line 183 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.
bool is_connected | ( | self | ) |
returns whether provider is connected
Definition at line 165 of file client.py.
References SubscriptionAsync.__client, and SubscriptionSync.__client.
Result metadata_async | ( | self, | |
str | address, | ||
ResponseCallback | cb, | ||
userData_c_void_p | userdata = None |
||
) |
Read metadata of an object.
This function is asynchronous. It will return immediately. Callback will be called if function call is finished. Result data may be provided in callback function.
[in] | address | Address of the node to read metadata |
[in] | callback | Callback to call when function is finished |
[in] | userdata | User data - will be returned in callback as userdata. You can use this userdata to identify your request |
Definition at line 402 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, ProviderNode.__create_callback(), Client.__create_callback(), and Client.__token.
def metadata_sync | ( | self, | |
str | address | ||
) |
Read metadata of an object.
This function is synchronous: It will wait for the answer.
[in] | address | Address of the node to read metadata of |
Definition at line 280 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.
Result ping_async | ( | self, | |
ResponseCallback | cb, | ||
userData_c_void_p | userdata = None |
||
) |
Ping the next hop.
This function is asynchronous. It will return immediately. Callback will be called if function call is finished.
[in] | callback | Callback to call when function is finished |
[in] | userdata | User data - will be returned in callback as userdata. You can use this userdata to identify your request |
Definition at line 293 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, ProviderNode.__create_callback(), and Client.__create_callback().
Result ping_sync | ( | self | ) |
Ping the next hop.
This function is synchronous: It will wait for the answer.
Definition at line 193 of file client.py.
References SubscriptionAsync.__client, and SubscriptionSync.__client.
Result read_async | ( | self, | |
str | address, | ||
ResponseCallback | cb, | ||
userData_c_void_p | userdata = None |
||
) |
Read an object.
This function is asynchronous. It will return immediately. Callback will be called if function call is finished. Result data may be provided in callback function.
[in] | address | Address of the node to read |
[in] | callback | Callback to call when function is finished |
[in] | userdata | User data - will be returned in callback as userdata. You can use this userdata to identify your request |
Definition at line 351 of file client.py.
References Client.read_async_args().
Result read_async_args | ( | self, | |
str | address, | ||
Variant | args, | ||
ResponseCallback | cb, | ||
userData_c_void_p | userdata = None |
||
) |
Read an object.
This function is asynchronous. It will return immediately. Callback will be called if function call is finished. Result data may be provided in callback function.
[in] | address | Address of the node to read |
[in] | args | Read arguments data of the node |
[in] | callback | Callback to call when function is finished |
[in] | userdata | User data - will be returned in callback as userdata. You can use this userdata to identify your request |
Definition at line 364 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, ProviderNode.__create_callback(), Client.__create_callback(), and Client.__token.
Referenced by Client.read_async().
This function reads a values as a JSON string.
[in] | converter | Reference to the converter (see System json_converter()) |
[in] | address | Address of the node to read |
[in] | indentStep | Indentation length for json string |
[in] | json | Generated JSON as Variant (string) |
Definition at line 472 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.
def read_sync | ( | self, | |
str | address | ||
) |
Read an object.
This function is synchronous: It will wait for the answer.
[in] | address | Address of the node to read |
Definition at line 241 of file client.py.
References Client.read_sync_args().
def read_sync_args | ( | self, | |
str | address, | ||
Variant | args | ||
) |
Read an object.
This function is synchronous: It will wait for the answer.
[in] | address | Address of the node to read |
[in,out] | args | Read arguments data of the node |
Definition at line 253 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.
Referenced by Client.read_sync().
Result remove_async | ( | self, | |
str | address, | ||
ResponseCallback | cb, | ||
userData_c_void_p | userdata = None |
||
) |
Remove an object.
This function is asynchronous. It will return immediately. Callback will be called if function call is finished. Result data may be provided in callback function.
[in] | address | Address of the node to remove |
[in] | callback | Callback to call when function is finished |
[in] | userdata | User data - will be returned in callback as userdata. You can use this userdata to identify your request |
Definition at line 319 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, ProviderNode.__create_callback(), Client.__create_callback(), and Client.__token.
Result remove_sync | ( | self, | |
str | address | ||
) |
Remove an object.
This function is synchronous: It will wait for the answer.
[in] | address | Address of the node to remove |
Definition at line 215 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.
def set_auth_token | ( | self, | |
str | token | ||
) |
Set persistent security access token for authentication as JWT payload.
[in] | token | Security access &token for authentication |
Definition at line 172 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.
Result set_timeout | ( | self, | |
TimeoutSetting | timeout, | ||
int | value | ||
) |
Set client timeout value.
[in] | timeout | Timeout to set (see DLR_TIMEOUT_SETTING) |
[in] | value | Value to set |
Definition at line 157 of file client.py.
References SubscriptionAsync.__client, and SubscriptionSync.__client.
Result write_async | ( | self, | |
str | address, | ||
Variant | data, | ||
ResponseCallback | cb, | ||
userData_c_void_p | userdata = None |
||
) |
Write an object.
This function is synchronous: It will wait for the answer.
[in] | address | Address of the node to read metadata |
[in] | data | Data of the object |
[in] | callback | Callback to call when function is finished |
[in] | userdata | User data - will be returned in callback as userdata. You can use this userdata to identify your request |
Definition at line 383 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, ProviderNode.__create_callback(), Client.__create_callback(), and Client.__token.
def write_json_sync | ( | self, | |
Converter | conv, | ||
str | address, | ||
str | json | ||
) |
This function writes a JSON value.
[in] | converter | Reference to the converter (see System json_converter()) |
[in] | address | Address of the node to write |
[in] | json | JSON value to write |
[in,out] | error | Error of conversion as variant string |
Definition at line 496 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.
def write_sync | ( | self, | |
str | address, | ||
Variant | data | ||
) |
Write an object.
This function is synchronous: It will wait for the answer.
[in] | address | Address of the node to write |
[in] | variant | New data of the node |
Definition at line 267 of file client.py.
References SubscriptionAsync.__client, SubscriptionSync.__client, and Client.__token.