HTTP monitoring states

Perform an HTTP query and statefully return the result

New in version 2015.5.0.

salt.states.http.query(name, match=None, match_type='string', status=None, wait_for=None, **kwargs)

Perform an HTTP query and statefully return the result

Passes through all the parameters described in the utils.http.query function:


The name of the query.


Specifies a pattern to look for in the return text. By default, this will perform a string comparison of looking for the value of match in the return text.


Specifies the type of pattern matching to use. Default is string, but can also be set to pcre to use regular expression matching if a more complex pattern matching is required.


Despite the name of match_type for this argument, this setting actually uses Python's function rather than Python's re.match() function.


The status code for a URL for which to be checked. Can be used instead of or in addition to the match setting.

If both match and status options are set, both settings will be checked. However, note that if only one option is True and the other is False, then False will be returned. If this case is reached, the comments in the return data will contain troubleshooting information.

For more information about the http.query state, refer to the HTTP Tutorial.

    - name: ''
    - status: 200
salt.states.http.wait_for_successful_query(name, wait_for=300, **kwargs)

Like query but, repeat and wait until match/match_type or status is fulfilled. State returns result from last query state in case of success or if no successful query was made within wait_for timeout.


The name of the query.


Total time to wait for requests that succeed.


Optional interval to delay requests by N seconds to reduce the number of requests sent.


All other arguments are passed to the http.query state.