Trigger Jobs with REST API

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
DirkDittmar
Posts: 2
Joined: 01 Sep 2017, 14:20

Trigger Jobs with REST API

Post by DirkDittmar » 01 Sep 2017, 14:45

Hi,

first of all I have to admit that I'm absolutely new to Aimeos and I'm not very good at PHP. So sorry if this is a stupid question. I'm using 2017.07.4 (core) with Slim 3.8.1 and PHP 7.0 ...

I have to trigger the jobs through a REST API.

I've looked at

Code: Select all

jobs.php
and of cause I looked at

Code: Select all

\Aimeos\Slim\Command\Jobs
. My idea was to do something like the

Code: Select all

\Aimeos\Slim\Command\Jobs::execute()
method. The problem is that I can not get the required objects.

Any idea welcome :)


Regards,

Dirk

User avatar
aimeos
Administrator
Posts: 7835
Joined: 01 Jan 1970, 00:00

Re: Trigger Jobs with REST API

Post by aimeos » 03 Sep 2017, 08:13

You will get into maximum execution time problems if you execute the jobs from a web environment. Instead, you should store the job requests in a file or the database and execute the jobs by a cronjob regularly depending on the stored requests.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

DirkDittmar
Posts: 2
Joined: 01 Sep 2017, 14:20

Re: Trigger Jobs with REST API

Post by DirkDittmar » 03 Sep 2017, 09:07

Maybe I missunderstand your answer.
But I can not execute cronjobs on the server. So I have to trigger them on a different way.

User avatar
aimeos
Administrator
Posts: 7835
Joined: 01 Jan 1970, 00:00

Re: Trigger Jobs with REST API

Post by aimeos » 04 Sep 2017, 08:46

You can copy the jobs.php file and remove the check for the CLI environment. But be careful to protect the new script by HTTP auth or something similar. Otherwise, everybody can execute all jobs.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply