How to test EventRule by HTTP API

Answered

Comments

5 comments

  • Avatar
    Anton Babinov

    Hello Jhen,

    could you please show me created event rule and request that you used to create it?

    Not all events types can be triggered via HTTP API, so I'm going to need more info about what you're trying to implement. What kind of user scenario are you trying to solve?

     

    0
    Comment actions Permalink
  • Avatar
    Tagir Gadelshin

    In addition to what Anton requested, I can add that we plan the Event Rules engine refactoring in some of the upcoming releases. And "Test" will be added in UI, and, I hope, in API. So you'd call, e.g., /testEventRule with rule id and it will work as the event section of the rule was triggered, you'll be able to see the reaction (action section of the rule).

    0
    Comment actions Permalink
  • Avatar
    Jhen Jhou Jhong

    Tagir Gadelshin That's what I need.

    I create cameraDisconnectEvent by HTTP API, the actionType is execHttpRequestAction.

    I want a HTTP API that can test EventRule, verify that my service can successfully receive it because I can't disconnect the camera in deployment environment.

    So, I can't use the API in the version 4.1.0.32405, it will be released in the future?

    0
    Comment actions Permalink
  • Avatar
    Anton Babinov

    So, I can't use the API in the version 4.1.0.32405, it will be released in the future?

    Yes, this feature is in development and will be available in future releases.

    I want a HTTP API that can test EventRule, verify that my service can successfully receive it because I can't disconnect the camera in deployment environment.

    Instead of using real camera from production, you can use Test Camera tool to emulate camera disconnected event. Start testcamera tool, add emulated camera to your server, create rule for it and then just stop testcamera process. 

    0
    Comment actions Permalink
  • Avatar
    Jhen Jhou Jhong

    Anton Babinov

    Thanks!

    I will try it next week.

     

    0
    Comment actions Permalink

Please sign in to leave a comment.