File: command_status.py

package info (click to toggle)
python-haproxyadmin 0.2.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 436 kB
  • sloc: python: 1,500; makefile: 165; sh: 1
file content (108 lines) | stat: -rw-r--r-- 5,098 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# -*- coding: utf-8 -*-
# vim:fenc=utf-8

"""
haproxyadmin.command_status.py
~~~~~~~~~~~~~~~~~~~

This module categorizes the output returned by various commands

"""
# CLI doesn't return a message if operation is successfully executed.
# But, versions prior 1.5.10 was returning 'Done.' message only for ACL/MAPs
# operations. 73f1d8f447087 commit in haproxy-1.5 makes the output consistent
# by removing 'Done.' message.
SUCCESS_OUTPUT_STRINGS = [
    'Done.',
    ''
]

ERROR_OUTPUT_STRINGS = [
    "'add acl' expects two parameters: ACL identifier and pattern.",
    "'add map' expects three parameters: map identifier, key and value.",
    "'add' only supports 'map'.",
    "A frontend name is expected.",
    "agent checks are not enabled on this server.",
    "Agent was not configured on this server, cannot enable.",
    "cannot change health on a tracking server.",
    "content-based lookup is only supported with the \"show\" and \"clear\" actions",
    "\"data.<type>\" followed by a value expected",
    "Data type not stored in this table",
    "'del' only supports 'map' or 'acl'.",
    "'disable' only supports 'agent', 'frontend', 'health', and 'server'.",
    "'enable' only supports 'agent', 'frontend', 'health', and 'server'.",
    "Entry currently in use, cannot remove",
    "Expects a maximum input byte rate in kB/s.",
    "Expects an integer value.",
    "Failed to pause frontend, check logs for precise cause.",
    "Failed to resume frontend, check logs for precise cause (port conflict?).",
    "Frontend is already disabled.",
    "Frontend is already enabled.",
    "Frontend was already shut down.",
    "Frontend was previously shut down, cannot disable.",
    "Frontend was previously shut down, cannot enable.",
    "HAProxy was compiled against a version of OpenSSL that doesn't support OCSP stapling.",
    "Health checks are not configured on this server, cannot enable.",
    "Integer value expected.",
    "Invalid key",
    "Invalid timeout value.",
    "Key not found.",
    "Key value expected",
    "Malformed identifier. Please use #<id> or <file>.",
    "Missing ACL identifier.",
    "Missing ACL identifier and/or key.",
    "Missing map identifier.",
    "Missing map identifier and/or key.",
    "No such backend.",
    "No such frontend.",
    "No such server.",
    "No such session (use 'show sess').",
    "No such table",
    "OCSP Response updated!",
    "Optional argument only supports \"data.<store_data_type>\" <operator> <value> and key <key>",
    "Out of memory error.",
    "Proxy is disabled.",
    "Removing keys from ip tables of type other than ip, ipv6, string and integer is not supported",
    "Require and operator among \"eq\", \"ne\", \"le\", \"ge\", \"lt\", \"gt\"",
    "Require a valid integer value to compare against",
    "Require a valid integer value to store",
    "Require 'backend/server'.",
    "Required arguments: <table> \"data.<store_data_type>\" <operator> <value> or <table> key <key>",
    "Session pointer expected (use 'show sess').",
    "'set map' expects three parameters: map identifier, key and value.",
    "'set maxconn' only supports 'frontend' and 'global'.",
    "'set rate-limit connections' only supports 'global'.",
    "'set rate-limit http-compression' only supports 'global'.",
    "'set rate-limit sessions' only supports 'global'.",
    "'set rate-limit ssl-sessions' only supports 'global'.",
    "'set rate-limit' supports 'connections', 'sessions', 'ssl-sessions', and 'http-compression'.",
    "'set server <srv> agent' expects 'up' or 'down'.",
    "'set server <srv> health' expects 'up', 'stopping', or 'down'.",
    "'set server <srv>' only supports 'agent', 'health', 'state', 'weight' add 'addr'.",
    "'set server <srv> state' expects 'ready', 'drain' and 'maint'.",
    "'set ssl ocsp-response' expects response in base64 encoding.",
    "'set ssl ocsp-response' received invalid base64 encoded response.",
    "'set ssl' only supports 'ocsp-response'.",
    "'set timeout' only supports 'cli'.",
    "Showing keys from tables of type other than ip, ipv6, string and integer is not supported",
    "'shutdown' only supports 'frontend', 'session' and 'sessions'.",
    "'shutdown sessions' only supports 'server'.",
    "This ACL is shared with a map containing samples. ",
    "This command expects two parameters: ACL identifier and key.",
    "This command expects two parameters: map identifier and key.",
    "Unable to allocate a new entry",
    "Unknown ACL identifier. Please use #<id> or <file>.",
    "Unknown action",
    "Unknown data type",
    "Unknown map identifier. Please use #<id> or <file>.",
    "Unknown command. Please enter one of the following commands only :",
    "Value out of range.",
    "Missing resolver section identifier.",
    "Can't find resolvers section.",
    "Can't find backend.",
]

SUCCESS_STRING_ADDRESS = "IP changed from|no need to change the addr"
SUCCESS_STRING_PORT = ("no need to change the addr, port changed from|no need "
                       "to change the addr, no need to change the port"
                      )