Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to add an AASX package via the API? #130

Closed
vChavezB opened this issue Jul 20, 2022 · 6 comments
Closed

Is it possible to add an AASX package via the API? #130

vChavezB opened this issue Jul 20, 2022 · 6 comments

Comments

@vChavezB
Copy link

vChavezB commented Jul 20, 2022

I read the README.md file and saw the API for this project. Is it possible to upload a package to the server via the API or can it only be done via the package explorer?

Please correct me if I am wrong as I am new to the Asset administration shell.

@juileetikekar
Copy link
Contributor

Hi @vChavezB ,

Thank you for your question.

In current AasxServer/master, there are two kinds of APIs: one with Grapevine (mentioned in README) and one with Asp.Net core (new). The status of these APIs w.r.t. your question is as below:

Question: Is it possible to upload a package to AasxServer via API?

Status:

  1. APIs with Asp.Net core: Yes
    API to upload new package: PostAASXPackage
    API to update existing (already loaded) package: PutAASXPackageById

  2. APIs with Grapevine: Partially
    API to upload new package: NOT Possible
    API to update existing (already loaded) package: Possible, Api (HttpMethod = HttpMethod.PUT, PathInfo = @"^/server/getaasx/(\d+)(/|)$")

To connect to new APIs with Asp.Net core:
The new REST endpoint is : http:// <Host_Name> :5001/
Swagger documentation for these APIs can be found at : http://<Host_Name>:5001/swagger/index.html
Package explorer can be connected to Aasx-Server by: File -> AASX File Repository -> Connect HTTP/REST Repository and
appending "?asp.net" to the new REST endoint as shown in the screenshot.

image

The documentation of these new APIs will be released soon.

@vChavezB
Copy link
Author

Dear @juileetikekar thanks for the insightful answer. This definitely helps a lot. I will test the aforementioned APIs.

@vChavezB
Copy link
Author

Is this feature with ASP Net core enabled in the latest release binaries or do I have to use the source files ?

I can access the endpoint

http://localhost:51310/server/listaas

but cannot connect to the server with package explorer ?asp.net URL at the end.

@juileetikekar
Copy link
Contributor

Hi @vChavezB ,

The binaries have been now updated and the latest binaries now consist of the features mentioned in my earlier comment.

@vChavezB
Copy link
Author

Thanks for the update. I tried running

AasxServerCore --rest --no-security -p 5001

but I could not access the swagger API through

http://localhost:5001/swagger/index.html

Did I miss something on the command arguments?

Thanks in advanced

@vChavezB
Copy link
Author

Update on this issue, it was not mentioned which variant has the port 5001 opened. After checking the source code I found that the BLAZOR variant should be used for the aforementioned new API

https://github.com/admin-shell-io/aasx-server/blob/a95e2da34dc866ff50a5bee2838aea36349fea48/src/AasxServerBlazor/Properties/launchSettings.json#L26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants