mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Fix doc build errors in saltnado documentation
This commit is contained in:
parent
75a3b52215
commit
393bc0fb59
@ -608,7 +608,7 @@ class SaltAuthHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
'''
|
||||
def get(self):
|
||||
'''
|
||||
All logins are done over post, this is a parked enpoint
|
||||
All logins are done over post, this is a parked endpoint
|
||||
|
||||
.. http:get:: /login
|
||||
|
||||
@ -621,7 +621,7 @@ class SaltAuthHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
curl -i localhost:8000/login
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
GET /login HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -629,7 +629,7 @@ class SaltAuthHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
**Example response:**
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 401 Unauthorized
|
||||
Content-Type: application/json
|
||||
@ -676,7 +676,7 @@ class SaltAuthHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
-d password='saltpass' \\
|
||||
-d eauth='pam'
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
POST / HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -688,7 +688,7 @@ class SaltAuthHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
**Example response:**
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
@ -767,7 +767,7 @@ class SaltAPIHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
'''
|
||||
def get(self):
|
||||
'''
|
||||
An enpoint to determine salt-api capabilities
|
||||
An endpoint to determine salt-api capabilities
|
||||
|
||||
.. http:get:: /
|
||||
|
||||
@ -783,7 +783,7 @@ class SaltAPIHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
curl -i localhost:8000
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
GET / HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -791,7 +791,7 @@ class SaltAPIHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
**Example response:**
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
@ -835,7 +835,7 @@ class SaltAPIHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
-d fun='test.ping' \\
|
||||
-d arg
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
POST / HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -847,11 +847,12 @@ class SaltAPIHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
fun=test.ping&arg&client=local&tgt=*
|
||||
|
||||
**Example response:**
|
||||
|
||||
Responses are an in-order list of the lowstate's return data. In the
|
||||
event of an exception running a command the return will be a string
|
||||
instead of a mapping.
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 200
|
||||
@ -866,10 +867,11 @@ class SaltAPIHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
ms-4: true
|
||||
|
||||
.. admonition:: multiple commands
|
||||
|
||||
Note that if multiple :term:`lowstate` structures are sent, the Salt
|
||||
API will execute them in serial, and will not stop execution upon failure
|
||||
of a previous job. If you need to have commands executed in order and
|
||||
stop on failure please use compount-command-execution.
|
||||
stop on failure please use compound-command-execution.
|
||||
|
||||
'''
|
||||
# if you aren't authenticated, redirect to login
|
||||
@ -970,7 +972,8 @@ class SaltAPIHandler(BaseSaltAPIHandler): # pylint: disable=W0223
|
||||
is_finished)
|
||||
|
||||
def more_todo():
|
||||
'''Check if there are any more minions we are waiting on returns from
|
||||
'''
|
||||
Check if there are any more minions we are waiting on returns from
|
||||
'''
|
||||
return any(x is False for x in six.itervalues(minions))
|
||||
|
||||
@ -1133,7 +1136,7 @@ class MinionSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
curl -i localhost:8000/minions/ms-3
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
GET /minions/ms-3 HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -1141,7 +1144,7 @@ class MinionSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
**Example response:**
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 129005
|
||||
@ -1194,7 +1197,7 @@ class MinionSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
-d tgt='*' \\
|
||||
-d fun='status.diskusage'
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
POST /minions HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -1206,7 +1209,7 @@ class MinionSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
**Example response:**
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 202 Accepted
|
||||
Content-Length: 86
|
||||
@ -1261,7 +1264,7 @@ class JobsSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
curl -i localhost:8000/jobs
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
GET /jobs HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -1269,7 +1272,7 @@ class JobsSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
**Example response:**
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 165
|
||||
@ -1290,7 +1293,7 @@ class JobsSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
curl -i localhost:8000/jobs/20121130104633606931
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
GET /jobs/20121130104633606931 HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -1298,7 +1301,7 @@ class JobsSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
**Example response:**
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 73
|
||||
@ -1379,7 +1382,7 @@ class RunSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
-d password='saltdev' \\
|
||||
-d eauth='pam'
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
POST /run HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -1391,7 +1394,7 @@ class RunSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
**Example response:**
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 73
|
||||
@ -1438,14 +1441,14 @@ class EventsSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
curl -NsS localhost:8000/events
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
GET /events HTTP/1.1
|
||||
Host: localhost:8000
|
||||
|
||||
**Example response:**
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Connection: keep-alive
|
||||
@ -1593,7 +1596,7 @@ class WebhookSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
curl -sS localhost:8000/hook -d foo='Foo!' -d bar='Bar!'
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
POST /hook HTTP/1.1
|
||||
Host: localhost:8000
|
||||
@ -1604,7 +1607,7 @@ class WebhookSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
**Example response**:
|
||||
|
||||
.. code-block:: http
|
||||
.. code-block:: text
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 14
|
||||
@ -1617,7 +1620,9 @@ class WebhookSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
``http://localhost:8000/hook/mycompany/build/success`` which contains
|
||||
the result of a build and the SHA of the version that was built as
|
||||
JSON. That would then produce the following event in Salt that could be
|
||||
used to kick off a deployment via Salt's Reactor::
|
||||
used to kick off a deployment via Salt's Reactor:
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
Event fired at Fri Feb 14 17:40:11 2014
|
||||
*************************
|
||||
@ -1642,7 +1647,7 @@ class WebhookSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
And finally deploy the new build:
|
||||
|
||||
.. code-block:: yaml
|
||||
.. code-block:: jinja
|
||||
|
||||
{% set secret_key = data.get('headers', {}).get('X-My-Secret-Key') %}
|
||||
{% set build = data.get('post', {}) %}
|
||||
@ -1697,9 +1702,9 @@ class WebhookSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
|
||||
|
||||
|
||||
def _check_cors_origin(origin, allowed_origins):
|
||||
"""
|
||||
'''
|
||||
Check if an origin match cors allowed origins
|
||||
"""
|
||||
'''
|
||||
if isinstance(allowed_origins, list):
|
||||
if origin in allowed_origins:
|
||||
return origin
|
||||
|
Loading…
Reference in New Issue
Block a user