1
0

0.8.4.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ==============
  2. salt-api 0.8.4
  3. ==============
  4. :program:`salt-api` 0.8.4 sees a number of new features and feature
  5. enhancements in the :py:mod:`rest_cherrypy <salt.netapi.rest_cherrypy.app>`
  6. netapi module.
  7. Work to merge :program:`salt-api` into the main Salt distribution continues and
  8. it is likely to be included in Salt's 2014.7.0 release.
  9. :py:mod:`rest_cherrypy <salt.netapi.rest_cherrypy.app>` changes
  10. ==================================================================
  11. Web hooks
  12. ---------
  13. This release adds a :py:class:`new URL /hook
  14. <salt.netapi.rest_cherrypy.app.Webhook>` that allows salt-api to serve as a
  15. generic web hook interface for Salt. POST requests to the URL trigger events on
  16. Salt's event bus.
  17. External services like Amazon SNS, Travis CI, GitHub, etc can easily send
  18. signals through Salt's Reactor.
  19. The following HTTP call will trigger the following Salt event.
  20. .. code-block:: bash
  21. % curl -sS http://localhost:8000/hook/some/tag \
  22. -d some='Data!'
  23. Event tag: ``salt/netapi/hook/some/tag``. Event data:
  24. .. code-block:: json
  25. {
  26. "_stamp": "2014-04-04T12:14:54.389614",
  27. "post": {
  28. "some": "Data!"
  29. },
  30. "headers": {
  31. "Content-Type": "application/x-www-form-urlencoded",
  32. "Host": "localhost:8000",
  33. "User-Agent": "curl/7.32.0",
  34. "Accept": "*/*",
  35. "Content-Length": "10",
  36. "Remote-Addr": "127.0.0.1"
  37. }
  38. }
  39. Batch mode
  40. ----------
  41. The :py:meth:`~salt.netapi.NetapiClient.local_batch` client exposes Salt's batch mode
  42. for executing commands on incremental subsets of minions.
  43. Tests!
  44. ------
  45. We have added the necessary framework for testing the rest_cherrypy module and
  46. this release includes a number of both unit and integration tests. The suite
  47. can be run with the following command:
  48. .. code-block:: bash
  49. python -m unittest discover -v
  50. CherryPy server stats and configuration
  51. ---------------------------------------
  52. A number of settings have been added to better configure the performance of the
  53. CherryPy web server. In addition, a :py:class:`new URL /stats
  54. <salt.netapi.rest_cherrypy.app.Stats>` has been added to expose metrics on
  55. the health of the CherryPy web server.
  56. Improvements for running with external WSGI servers
  57. ---------------------------------------------------
  58. Running the ``rest_cherrypy`` module via a WSGI-capable server such as Apache
  59. or Nginx can be tricky since the user the server is running as must have
  60. permission to access the running Salt system. This release eases some of those
  61. restrictions by accessing Salt's key interface through the external auth
  62. system. Read access to the Salt configuration is required for the user the
  63. server is running as and everything else should go through external auth.
  64. More information in the jobs URLs
  65. ---------------------------------
  66. The output for the :py:class:`/jobs/<jid> URLs
  67. <salt.netapi.rest_cherrypy.app.Jobs>` has been augmented with more
  68. information about the job such as which minions are expected to return for that
  69. job. This same output will be added to the other salt-api URLs in the next
  70. release.
  71. Improvements to the Server Sent Events stream
  72. ---------------------------------------------
  73. Event tags have been added to :py:class:`the HTTP event stream
  74. <salt.netapi.rest_cherrypy.app.Event>` as SSE tags which allows JavaScript
  75. or other consumers to more easily match on certain tags without having to
  76. inspect the whole event.