Does an API to upload solutions exist?

Forum to discuss the new web client version of Servoy.

Does an API to upload solutions exist?

Postby rmidata » Sun Apr 02, 2023 5:25 pm

Hello,
In order to avoid entering servoy_admin and having to import solutions, is there an API to be able to import with a solution?
I remember that for the Servoy 7 version there was a solution called AppServerUpdater but I can't find it
Are there possibilities to import the solutions with an API?
Thanks and regards
Roberto
Roberto Diez.
Interdata Software.
Santa Fe, Argentina.
User avatar
rmidata
 
Posts: 42
Joined: Thu Jul 09, 2009 10:26 pm
Location: Santa Fe, Argentina.

Re: Does an API to upload solutions exist?

Postby swingman » Mon Apr 03, 2023 7:27 pm

Hi Roberto,

If you upload a .war file to a Tomcat server (possible to do with a script), it will be automatically deployed.
You can add versioning to the .war file name so your newer .war will take over, like my solution##20230403 or similar.
If users are connected, you will end up with two versions of your solution running at the same time. New users will get the new one.
Not sure there is a way to automatically get rid of the old version.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Does an API to upload solutions exist?

Postby rmidata » Tue Apr 04, 2023 2:21 am

Hi, Christian
We generate a .war and since we have a large number of solutions we upload them to the server according to the needs. We do not generate a .war with the solutions included
We would like to automate the process of uploading solutions to the server and I remember that back in version 7 there was the possibility of automating this upload of solutions
I want to know if the API with which this process could be done still exists. At that time we used the API, then we abandoned it and now that we want to resume it I realize that it no longer exists, or so it seems to me, that's why it is my query
I copy part of the code that we used at that time.

Code: Select all
        var client = plugins.http.createNewHttpClient();
   var poster = client.createPostRequest(http_company + '/integra8/servoy-admin/solutions/import')

   poster.addFile('if',import_solution)

   poster.addParameter('emm', '1'); //Enter  maintenance mode - default 1
   poster.addParameter('ac', '1');  //Activate new release of imported solution and modules - default 1
   poster.addParameter('os', '1');  //Overwrite repository styles with import version - default 1
   poster.addParameter('om', '1');  //Overwrite repository media with import version - default 1
   poster.addParameter('og', '1');  //Overwrite repository group security settings with import version - default 1
   poster.addParameter('ak', '1');  //Allow reserved SQL keywords as table or column names (will fail unless supported by the backend database)
   poster.addParameter('dm', '1');  //Allow data model (database) changes  - default 1
   poster.addParameter('md', '1');  //Import solution meta data - default 1
   poster.addParameter('up', '0');  //Hard coded no user import - 1 will create non existing add to groups 2 is complete overwrite

   poster.addParameter('submit', 'Import!');

   var rtn = poster.executeRequest(user, passwd); // httpCode 200 is ok

   var httpCode = rtn.getStatusCode();
   application.output(httpCode);

   var respBody = rtn.getResponseBody()
   application.output('Body: ' + respBody)


This code with Servoy 2022.12.x is not working, did something change API connection?
Thanks and regards
Roberto
Roberto Diez.
Interdata Software.
Santa Fe, Argentina.
User avatar
rmidata
 
Posts: 42
Joined: Thu Jul 09, 2009 10:26 pm
Location: Santa Fe, Argentina.


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 5 guests

cron