Changelog: https://haproxy-wi.org/changelog.py#5_3_3
This commit is contained in:
Pavel Loginov
2021-11-17 15:35:22 +06:00
parent c135cb0876
commit 4560152621
2 changed files with 60 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ def index():
'haproxy/<id,hostname,ip>/log':'show HAProxy log by id or hostname or ip. May to have config next headers: rows(format INT) default: 10 grep, waf(if needs WAF log) default: 0, start_hour(format: 24) default: 00, start_minute, end_hour(format: 24) default: 24, end_minute. METHOD: GET',
'haproxy/<id,hostname,ip>/section':'show certain section, headers: section-name. METHOD: GET',
'haproxy/<id,hostname,ip>/section/add':'add section to the HAProxy config by id or hostname or ip. Has to have config header with section and action header for action after upload. Section header must consist type: listen, frontend, etc. Action header accepts next value: save, test, reload and restart. Can be empty for just save. METHOD: POST',
'haproxy/<id,hostname,ip>/section/edit':'edit section in the HAProxy config by id or hostname or ip. Has to have config header with section, action header for action after upload and body of a new section configuration. Section header must consist type: listen, frontend, etc. Action header accepts next value: save, test, reload and restart. Can be empty for just save. METHOD: POST',
'haproxy/<id,hostname,ip>/acl':'add acl to certain section. Must be JSON body: "section-name", "if", "then", "if_value", "then_value" and "action" for action after upload. Action accepts next value: "save", "test", "reload" and "restart". METHOD: POST',
'haproxy/<id,hostname,ip>/acl':'delete acl to certain section. Must be JSON body: "section-name", "if", "then", "if_value", "then_value" and "action" for action after upload. Action accepts next value: "save", "test", "reload" and "restart". METHOD: DELETE'
}
@@ -185,6 +186,14 @@ def callback(haproxy_id):
return api_funct.add_to_config(haproxy_id)
@route('/haproxy/<haproxy_id>/section/edit', method=['POST'])
@route('/haproxy/<haproxy_id:int>/section/edit', method=['POST'])
def callback(haproxy_id):
if not check_login(required_service=1):
return dict(error=_error_auth)
return api_funct.edit_section(haproxy_id)
@route('/haproxy/<haproxy_id>/acl', method=['POST'])
def add_acl(haproxy_id):
if not check_login(required_service=1):