Simpler compute over the API

Description of the limitation and why it is relevant to address

As a a developer I want to be able to simply call a VIKTOR app over the API so that i can use the logic outside the app

I think this is relevant for the VIKTOR platform because it enlarges the reach that the programmed logic has

Design

  • Simplify the REST API, making it more consistent and easy to process
  • Add methods to the api_v1 module in the sdk to simplify calling apps if you’re coding in python

Current workarounds

Using the current REST API for compute is possible but cumbersome

@Tom_Nillesen: I believe you have an app calling another app. This development makes this a lot simpler to implement.

1 Like

This has now been released with the new SDK v14.12.0 version :tada:

Starting a calculation over the API in python has become as simple as

entity.compute(method_name="my_calculation", params={...})

Read more about it in the docs and drop a comment here if you like it :slight_smile: (also if you don’t :wink: )

Tagging a few people here since i believe it might be interesting for them: @Tom_Nillesen, @Enrique , @Johan_Tuls , @Wichard

U R Awesome GIF by Verohallinto

1 Like

Thanks for the update! And tagging :slight_smile:

I think it helps a lot, however as it asks for params, i assume it is mainly to reuse logic behind the end-point. We usually do that by making use of our own packages or services.

So not completely sure how often we will use it this way, it doesn’t however lower the treshold level a lot ^^

We will try it out for some features this sprint, i’ll let you know!

Indeed this is about reusing logic behind an endpoint. You can actually use it create services like you mention. Do you foresee using it that way? Or will you keep using the services you have created yourself?

Using packages is indeed another nice way to re-use logic!

For just getting data, we have different methods in the the api module (recently we added the possibility to insert the workspace_id and token and access data of another workspace).

1 Like