odoo10-addon-webhook


Nameodoo10-addon-webhook JSON
Version 10.0.1.0.0 PyPI version JSON
download
home_pagehttps://www.vauxoo.com
SummaryWebhook
upload_time2017-09-02 04:30:26
maintainer
docs_urlNone
authorVauxoo, Odoo Community Association (OCA)
requires_python
licenseAGPL-3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
   :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
   :alt: License: AGPL-3

=======
Webhook
=======

Module to receive `webhook <https://en.wikipedia.org/wiki/Webhook>`_ events.
This module invoke methods to process webhook events.


Configuration
=============

You will need create a new module to add your logic to process the events with methods called:
*def run_CONSUMER_EVENT\**
Example with gihub consumer and push event.

.. code-block:: python

    @api.one
    def run_github_push_task(self):
        # You will have all request data in 
        # variable: self.env.request
        pass


Where CONSUMER is the name of you webhook consumer. e.g. github (Extract from field *name* of *webhook* model)
Where EVENT is the name of the event from webhook *request* data.
Where *\** is your particular method to process this event.

To configure a new webhook you need add all ip or subnet address (with *ip/integer*) owned by your webhook consumer in webhook.address model as data.

Example with github:

.. code-block:: xml

    <!--webhook github data of remote address-->
    <record model="webhook.address" id="webhook_address_github">
        <field name="name">192.30.252.0/22</field>
        <field name="webhook_id" ref="webhook_github"/>
    </record>


You need to add a python code to extract event name from webhook request info into `python_code_get_event` field of webhook model.
You can get all full data of request webhook from variable `request`
Example with github:

.. code-block:: xml

    <!--webhook github data-->
    <record model="webhook" id="webhook_github">
        <field name="name">github</field>
        <field name="python_code_get_event">request.httprequest.headers.get('X-Github-Event')</field>
    </record>


Full example of create a new webhook configuration data.

.. code-block:: xml

    <?xml version="1.0" encoding="UTF-8"?>
    <openerp>
        <data>

            <!--webhook github data-->
            <record model="webhook" id="webhook_github">
                <field name="name">github</field>
                <field name="python_code_get_event">request.httprequest.headers.get('X-Github-Event')</field>
            </record>
            <!--webhook github data of remote address-->
            <record model="webhook.address" id="webhook_address_github">
                <field name="name">192.30.252.0/22</field>
                <field name="webhook_id" ref="webhook_github"/>
            </record>

        </data>
    </openerp>


.. figure:: path/to/local/image.png
   :alt: alternative description
   :width: 600 px

Usage
=====

To use this module, you need to:

#. Go to your customer webhook configuration from 3rd-party applications
   and use the odoo webhook url HOST/webhook/NAME_WEBHOOK

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
   :alt: Try me on Runbot
   :target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch}

.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
.. branch is "8.0" for example


Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Moisés López <moylop260@vauxoo.com>

Funders
-------

The development of this module has been financially supported by:

* Vauxoo

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.



            

Raw data

            {
    "_id": null,
    "home_page": "https://www.vauxoo.com",
    "name": "odoo10-addon-webhook",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Vauxoo, Odoo Community Association (OCA)",
    "author_email": "support@odoo-community.org",
    "download_url": "",
    "platform": "",
    "description": ".. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg\n   :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html\n   :alt: License: AGPL-3\n\n=======\nWebhook\n=======\n\nModule to receive `webhook <https://en.wikipedia.org/wiki/Webhook>`_ events.\nThis module invoke methods to process webhook events.\n\n\nConfiguration\n=============\n\nYou will need create a new module to add your logic to process the events with methods called:\n*def run_CONSUMER_EVENT\\**\nExample with gihub consumer and push event.\n\n.. code-block:: python\n\n    @api.one\n    def run_github_push_task(self):\n        # You will have all request data in \n        # variable: self.env.request\n        pass\n\n\nWhere CONSUMER is the name of you webhook consumer. e.g. github (Extract from field *name* of *webhook* model)\nWhere EVENT is the name of the event from webhook *request* data.\nWhere *\\** is your particular method to process this event.\n\nTo configure a new webhook you need add all ip or subnet address (with *ip/integer*) owned by your webhook consumer in webhook.address model as data.\n\nExample with github:\n\n.. code-block:: xml\n\n    <!--webhook github data of remote address-->\n    <record model=\"webhook.address\" id=\"webhook_address_github\">\n        <field name=\"name\">192.30.252.0/22</field>\n        <field name=\"webhook_id\" ref=\"webhook_github\"/>\n    </record>\n\n\nYou need to add a python code to extract event name from webhook request info into `python_code_get_event` field of webhook model.\nYou can get all full data of request webhook from variable `request`\nExample with github:\n\n.. code-block:: xml\n\n    <!--webhook github data-->\n    <record model=\"webhook\" id=\"webhook_github\">\n        <field name=\"name\">github</field>\n        <field name=\"python_code_get_event\">request.httprequest.headers.get('X-Github-Event')</field>\n    </record>\n\n\nFull example of create a new webhook configuration data.\n\n.. code-block:: xml\n\n    <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    <openerp>\n        <data>\n\n            <!--webhook github data-->\n            <record model=\"webhook\" id=\"webhook_github\">\n                <field name=\"name\">github</field>\n                <field name=\"python_code_get_event\">request.httprequest.headers.get('X-Github-Event')</field>\n            </record>\n            <!--webhook github data of remote address-->\n            <record model=\"webhook.address\" id=\"webhook_address_github\">\n                <field name=\"name\">192.30.252.0/22</field>\n                <field name=\"webhook_id\" ref=\"webhook_github\"/>\n            </record>\n\n        </data>\n    </openerp>\n\n\n.. figure:: path/to/local/image.png\n   :alt: alternative description\n   :width: 600 px\n\nUsage\n=====\n\nTo use this module, you need to:\n\n#. Go to your customer webhook configuration from 3rd-party applications\n   and use the odoo webhook url HOST/webhook/NAME_WEBHOOK\n\n.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas\n   :alt: Try me on Runbot\n   :target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch}\n\n.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt\n.. branch is \"8.0\" for example\n\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues\n<https://github.com/OCA/server-tools/issues>`_. In case of trouble, please\ncheck there if your issue has already been reported. If you spotted it first,\nhelp us smash it by providing detailed and welcomed feedback.\n\nCredits\n=======\n\nImages\n------\n\n* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.\n\nContributors\n------------\n\n* Mois\u00e9s L\u00f3pez <moylop260@vauxoo.com>\n\nFunders\n-------\n\nThe development of this module has been financially supported by:\n\n* Vauxoo\n\nMaintainer\n----------\n\n.. image:: https://odoo-community.org/logo.png\n   :alt: Odoo Community Association\n   :target: https://odoo-community.org\n\nThis module is maintained by the OCA.\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\nTo contribute to this module, please visit https://odoo-community.org.\n\n\n",
    "bugtrack_url": null,
    "license": "AGPL-3",
    "summary": "Webhook",
    "version": "10.0.1.0.0",
    "project_urls": {
        "Homepage": "https://www.vauxoo.com"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "484156b608a801efa61af19f7bc64d154e31ea67a69ceb07218a3a7107718b39",
                "md5": "3724b32111bf6e427b47e44f1f65995b",
                "sha256": "08ee5a6b2363db27bdcf6ba2904b93f849f13a6c9d09b806f6cdc2f7fc765772"
            },
            "downloads": -1,
            "filename": "odoo10_addon_webhook-10.0.1.0.0-py2-none-any.whl",
            "has_sig": false,
            "md5_digest": "3724b32111bf6e427b47e44f1f65995b",
            "packagetype": "bdist_wheel",
            "python_version": "py2",
            "requires_python": null,
            "size": 16532,
            "upload_time": "2017-09-02T04:30:26",
            "upload_time_iso_8601": "2017-09-02T04:30:26.587490Z",
            "url": "https://files.pythonhosted.org/packages/48/41/56b608a801efa61af19f7bc64d154e31ea67a69ceb07218a3a7107718b39/odoo10_addon_webhook-10.0.1.0.0-py2-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2017-09-02 04:30:26",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "odoo10-addon-webhook"
}
        
Elapsed time: 0.09367s