|
Asset Connector Documentation
|
Functions | |
| ResponseBody | root () |
| Root endpoint that returns available endpoints. | |
| ResponseBody | add_or_update_config (SetConfigPayload payload) |
| Set or add configuration using an AID submodel. | |
| ResponseBody | get_value (GetValuePayload payload) |
| Get a current reading from a protocol-specific endpoint of the asset as specified in the AID submodel. | |
| ResponseBody | set_value (SetValuePayload payload) |
| Set a new value to a protocol-specific endpoint of the asset as specified in the AID submodel. | |
| start_app () | |
| Function to start the FastAPI application. | |
Variables | |
| app = FastAPI() | |
| logger = logging.getLogger(__name__) | |
| dict | connector_store = {} |
| connector_store_lock = threading.Lock() | |
| ResponseBody python_connector.main.add_or_update_config | ( | SetConfigPayload | payload | ) |
Set or add configuration using an AID submodel.
All interfaces defined in the provided AID will be analyzed and cached in an internal data structure. An interface is defined by the unique combination of submodel ID (ID of the AID) and interface name (IDshort). If an interface with the same AID-ID and name already exists, it will be overwritten.
If the protocol of the interface it supported by the implementation, an according co-routine will be added to handle the communication with the asset via the specified protocol and endpoints. Supported protocols are: MQTT, OPC UA, HTTP.
| payload | JSON object that is parsed as SetConfigPayload |
ResponseBody containing a status code and confirmation. | ResponseBody python_connector.main.get_value | ( | GetValuePayload | payload | ) |
Get a current reading from a protocol-specific endpoint of the asset as specified in the AID submodel.
Using a cached AID submodel (more concisely, an interface definition in the AID), a connection to the asset is established. A current reading from the endpoint of the asset if obtained and returned.
| payload | JSON object that is parsed as GetValuePayload |
ResponseBody containing a status code and the read value. | ResponseBody python_connector.main.root | ( | ) |
| ResponseBody python_connector.main.set_value | ( | SetValuePayload | payload | ) |
Set a new value to a protocol-specific endpoint of the asset as specified in the AID submodel.
Using a cached AID submodel (more concisely, an interface definition in the AID), a connection to the asset is established. The provided value is written to the endpoint of the asset.
| payload | JSON object that is parsed as SetValuePayload |
ResponseBody containing a status code and the read value. | python_connector.main.start_app | ( | ) |
| python_connector.main.connector_store_lock = threading.Lock() |