Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "BaSyx / Documentation / Components / AAS Server / Features / AASX Upload"

(Created page with "= AASX Upload Endpoint = == User Story & Use Case == ''As AAS Components user'' ''I want to upload AASX files via a dedicated HTTP/REST endpoint'' ''so that I don't need to...")
 
Line 13: Line 13:
 
If this feature is enabled, it is possible to use the following endpoint for uploading the file via multipart form upload with an HTTP-POST request:
 
If this feature is enabled, it is possible to use the following endpoint for uploading the file via multipart form upload with an HTTP-POST request:
 
  http://<server>:<port>/<contextPath>/shells/aasx
 
  http://<server>:<port>/<contextPath>/shells/aasx
 +
An .aasx-file has to be included as an entry in the multipart form data upload. The entry must have a non-empty name like e.g. "aasx" or "file".
  
 
Use the following code to create an AAS aggregator with AASX-Upload function:
 
Use the following code to create an AAS aggregator with AASX-Upload function:

Revision as of 04:05, 20 June 2023

AASX Upload Endpoint

User Story & Use Case

As AAS Components user

I want to upload AASX files via a dedicated HTTP/REST endpoint

so that I don't need to have any programming knowledge for uploading an AASX file


This feature can be used to integrate AAS and Submodels in an AASX file after AAS Server component start without having to write a single line of code.

Feature Overview

If this feature is enabled, it is possible to use the following endpoint for uploading the file via multipart form upload with an HTTP-POST request:

http://<server>:<port>/<contextPath>/shells/aasx

An .aasx-file has to be included as an entry in the multipart form data upload. The entry must have a non-empty name like e.g. "aasx" or "file".

Use the following code to create an AAS aggregator with AASX-Upload function:

 IAASAggregator aasAggregator = new AASAggregatorAASXUpload(new AASAggregator());

In order to upload an AASX package to the AAS-server, use the method uploadAAX(InputStream aasxStream)to upload an AASX-package. Befor that, it is worth to pay attention that the AASX-package must be load as an input-stream. The following code example shows how to perform this step. We assume that the path of the AASX-package is specified by the AASX_PATH with:

 public static final String AASX_PATH = "src/test/resources/aas/factory/aasx/01_Festo.aasx";

Uploading an aasx works as following:

 File file = Paths.get(AASX_PATH).toFile();
 aggregator.uploadAASX(new FileInputStream(file));

The complete unit-test for AASXUpload can be found under: https://github.com/eclipse-basyx/basyx-java-sdk/blob/main/src/test/java/org/eclipse/basyx/testsuite/regression/extensions/aas/aggregator/aasxupload/TestAASAggregatorAASXUploadSuite.java

Feature Configuration

This feature can be enabled via the aas.properties file. For this, add the following line to the file:

aas.aasxUpload=Enabled

Besides enabling or disabling (via Disabled), there's no need for additional configuration.

Back to the top