Publishing to ArupCompute
You can publish new libraries either with an easy web based wizard or manually via an API. You can follow similar steps to publish a new version of a library you have published previously.
Recompiling
Before publishing remember to recompile your code.
dotnet core / VS Code
Run the command dotnet publish
Visual Studio
Either use the menu Build > Build Solution
or press F6
Library Zip File
To publish a new library/version you first need a library zip file.
You can create one by putting all your dlls and dependencies in a zip file without any top level folder:
Remember to include all reference .dlls including the ArupCompute ones
Using the Web UI
Wizard
Then simply use the new web base wizard to publish it:
If you have been following the VS Code / dotnet core guidance, then here you should choose .NET Core
The Slug field is a unique string that identifies your library, currently it's only being used internally, but in the future it might be used to generate the URLs to your calculations.
The Version field enforces semantic versioning, you can add a suffix like "-beta" if publishing a pre-release.
The upload process might take up to a few minutes! Don't despair!
Once the upload finishes, if everything was process successfully you'll see the new library appear in a few minutes. If it doesn't happen let us know!
Manual publishing
New Library
If creating a new library simply make a POST
request to:
https://arupcomputefunctions.azurewebsites.net/api/library
with the following information:
{
"Name":"Sample Library",
"Slug":"samplelibrary",
"Assembly":"SampleLibrary.dll",
"UserId": 1
}
The UserId
corresponding to your user can be found by hitting the secured endpoint /api/users/me
.
A sample response is:
{
"libraryId": 1,
"name": "Sample Library",
"slug": "samplelibrary",
"assembly": "SampleLibrary.dll",
"repository": "",
"provider": "netframework",
"visibility": "public",
"userId": 1,
"user": null,
"libraryVersions": []
}
You can now proceed to create a new version for this library.
New Library Version
To publish a new version of a library, make a POST
request to:
https://arupcomputefunctions.azurewebsites.net/api/version?libraryid=1&version=1.0.0&description=MyStringEncodedDescription&userid=1&framework=1
With the appropriate query parameters libraryid
, version
, description
, userid
, framework
and with body the library zip file (use framework=1
for .NET Framework and framework=2
for .NET Core).
A sample response is:
{
"libraryId": 1,
"libraryVersionId": 1,
"date": "2019-12-03T18:44:39.3381965+00:00",
"major": 1,
"minor": 0,
"patch": 0,
"suffix": "",
"description": "MyStringEncodedDescription",
"sPrerelease": false,
"version": "1.0.0",
"libraryStatusId": 3,
"userId": 1,
"user": null,
"invokeUrl": "https://arupcompute-tf-samplelibrary1-0-0.azurewebsites.net/api/invoke"
}
The libraryStatusId
value corresponds to:
- 1 = successfully published
- 2 = unsuccessfully published
- 3 = publishing in process
You can refresh the libraryStatusId
by hitting the secured libraryVersion endpoint.