1 /*
2    Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License, version 2.0,
6    as published by the Free Software Foundation.
7 
8    This program is also distributed with certain software (including
9    but not limited to OpenSSL) that is licensed under separate terms,
10    as designated in a particular file or component or in included license
11    documentation.  The authors of MySQL hereby grant you an additional
12    permission to link the program and your derivative works with the
13    separately licensed software that they have included with MySQL.
14 
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License, version 2.0, for more details.
19 
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
23 */
24 
25 #ifndef MGMAPI_ERROR_H
26 #define MGMAPI_ERROR_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31   /**
32    *    Error codes
33    */
34   enum ndb_mgm_error {
35     /** Not an error */
36     NDB_MGM_NO_ERROR = 0,
37 
38     /* Request for service errors */
39     /** Supplied connectstring is illegal */
40     NDB_MGM_ILLEGAL_CONNECT_STRING = 1001,
41     /** Supplied NdbMgmHandle is illegal */
42     NDB_MGM_ILLEGAL_SERVER_HANDLE = 1005,
43     /** Illegal reply from server */
44     NDB_MGM_ILLEGAL_SERVER_REPLY = 1006,
45     /** Illegal number of nodes */
46     NDB_MGM_ILLEGAL_NUMBER_OF_NODES = 1007,
47     /** Illegal node status */
48     NDB_MGM_ILLEGAL_NODE_STATUS = 1008,
49     /** Memory allocation error */
50     NDB_MGM_OUT_OF_MEMORY = 1009,
51     /** Management server not connected */
52     NDB_MGM_SERVER_NOT_CONNECTED = 1010,
53     /** Could not connect to socker */
54     NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET = 1011,
55     /** Could not bind local address */
56     NDB_MGM_BIND_ADDRESS = 1012,
57 
58     /* Alloc node id failures */
59     /** Generic error, retry may succeed */
60     NDB_MGM_ALLOCID_ERROR = 1101,
61     /** Non retriable error */
62     NDB_MGM_ALLOCID_CONFIG_MISMATCH = 1102,
63 
64     /* Service errors - Start/Stop Node or System */
65     /** Start failed */
66     NDB_MGM_START_FAILED = 2001,
67     /** Stop failed */
68     NDB_MGM_STOP_FAILED = 2002,
69     /** Restart failed */
70     NDB_MGM_RESTART_FAILED = 2003,
71 
72     /* Service errors - Backup */
73     /** Unable to start backup */
74     NDB_MGM_COULD_NOT_START_BACKUP = 3001,
75     /** Unable to abort backup */
76     NDB_MGM_COULD_NOT_ABORT_BACKUP = 3002,
77 
78     /* Service errors - Single User Mode */
79     /** Unable to enter single user mode */
80     NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE = 4001,
81     /** Unable to exit single user mode */
82     NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002,
83 
84     /* Service errors - Configuration change */
85     /** Unable to start config change */
86     NDB_MGM_CONFIG_CHANGE_FAILED = 4011,
87     /** Unable to get configuration */
88     NDB_MGM_GET_CONFIG_FAILED = 4012,
89 
90     /* Usage errors */
91     /** Usage error */
92     NDB_MGM_USAGE_ERROR = 5001
93   };
94 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
95   struct Ndb_Mgm_Error_Msg {
96     enum ndb_mgm_error  code;
97     const char *        msg;
98   };
99 
100   extern const struct Ndb_Mgm_Error_Msg ndb_mgm_error_msgs[];
101   extern const int ndb_mgm_noOfErrorMsgs;
102 #endif
103 
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif
110