smia.assetconnection.http_asset_connection module¶
- class smia.assetconnection.http_asset_connection.HTTPAssetConnection[source]¶
Bases:
AssetConnectionThis class implements the asset connection for HTTP protocol.
- async configure_connection_by_aas_model(interface_aas_elem)[source]¶
This method configures the Asset Connection using the interface element defined in the AAS model.
- Parameters:
interface_aas_elem (basyx.aas.model.SubmodelElement) – element of the AAS model with the asset interface information.
- async connect_with_asset()[source]¶
This method performs the connection process to the Asset Connection.
- async execute_asset_service(interaction_metadata, service_input_data=None)[source]¶
This method sends a message to the asset and returns the response. The connection of the interface of the asset is already configured in ‘configure_connection_by_aas_model’ method, but the interaction metadata is provided in form of a Python object of AAS model (SubmodelElement).
- Parameters:
interaction_metadata (basyx.aas.model.SubmodelElement) – element of the AAS model with all metadata for the interaction with the asset.
service_input_data – object with the input data of the service
- Returns:
response information defined in the interaction metadata.
- Return type:
object
- async receive_msg_from_asset()[source]¶
This method receives a message from the asset through the Asset Connection.
- async extract_general_interaction_metadata(interaction_metadata)[source]¶
This method extracts the general interaction information from the interaction metadata object. Since this is an HTTP Asset Connection, information about the URI, headers and method name is obtained. All information is saved in the global variables of the class.
- Parameters:
interaction_metadata (basyx.aas.model.SubmodelElementCollection) – SubmodelElement of interactionMetadata.
- async get_complete_request_uri(forms_elem)[source]¶
This method gets the complete request URI from the forms element within the InteractionMetadata element. The information is saved in the global variables of the class.
- Parameters:
forms_elem (basyx.aas.model.submodelElementCollection) – SubmodelElement of forms within InteractionMetadata.
- async get_headers(forms_elem)[source]¶
This method gets the headers for the request from the forms element within the InteractionMetadata element. The information is saved in the global variables of the class.
- Parameters:
forms_elem (basyx.aas.model.submodelElementCollection) – SubmodelElement of forms within InteractionMetadata.
- async get_method_name(forms_elem)[source]¶
This method gets the method name of the request from the forms element within the InteractionMetadata element. The information is saved in the global variables of the class.
- Parameters:
forms_elem (basyx.aas.model.submodelElementCollection) – SubmodelElement of forms within InteractionMetadata.
- async add_asset_service_data(interaction_metadata, service_input_data)[source]¶
This method adds the required data of the asset service, using the skill params information (exposure element and skill input data). The information is saved in the global variables of the class.
- Parameters:
interaction_metadata (basyx.aas.model.SubmodelElementCollection) – SubmodelElement of interactionMetadata.
service_input_data (dict) – dictionary containing the input data of the asset service.
- class smia.assetconnection.http_asset_connection.HTTPAssetInterfaceSemantics[source]¶
Bases:
objectThis class contains the specific semanticIDs of HTTP interfaces.
- SEMANTICID_HTTP_INTERFACE_METHOD_NAME = 'https://www.w3.org/2011/http#methodName'¶
- SEMANTICID_HTTP_INTERFACE_HEADERS = 'https://www.w3.org/2011/http#headers'¶
- SEMANTICID_HTTP_INTERFACE_FIELD_NAME = 'https://www.w3.org/2011/http#fieldName'¶
- SEMANTICID_HTTP_INTERFACE_FIELD_VALUE = 'https://www.w3.org/2011/http#fieldValue'¶
- SEMANTICID_HTTP_INTERFACE_PARAMS = 'https://www.w3.org/2011/http#params'¶
- SEMANTICID_HTTP_INTERFACE_PARAM_NAME = 'https://www.w3.org/2011/http#paramName'¶
- SEMANTICID_HTTP_INTERFACE_PARAM_VALUE = 'https://www.w3.org/2011/http#paramValue'¶