MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
guidelines_schema.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2024, Oracle and/or its affiliates.
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 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 ROUTER_SRC_ROUTING_GUIDELINES_SCHEMA_H_
26#define ROUTER_SRC_ROUTING_GUIDELINES_SCHEMA_H_
27
28constexpr const char *const k_routing_guidelines_schema =
29 R"({
30 "$schema":"https://json-schema.org/draft/2020-12/schema",
31 "title":"MySQL Router routing guidelines engine document schema",
32 "type":"object",
33 "properties":{
34 "name":{
35 "description":"Name of the routing guidelines document",
36 "type":"string"
37 },
38 "version":{
39 "description":"Version of the routing guidelines document",
40 "type":"string"
41 },
42 "destinations":{
43 "description":"Entries representing set of MySQL server instances",
44 "type":"array",
45 "items":{
46 "type":"object",
47 "properties":{
48 "name":{
49 "description":"Unique name of the given destinations entry",
50 "type":"string"
51 },
52 "match":{
53 "description":"Matching criteria for destinations class",
54 "type":"string"
55 }
56 },
57 "required":[
58 "name",
59 "match"
60 ]
61 },
62 "minItems":1,
63 "uniqueItems":true
64 },
65 "routes":{
66 "description":"Routes entries that are binding destinations with connection matching criteria",
67 "type":"array",
68 "items":{
69 "type":"object",
70 "properties":{
71 "name":{
72 "description":"Name of the route",
73 "type":"string"
74 },
75 "connectionSharingAllowed":{
76 "type":"boolean"
77 },
78 "enabled":{
79 "type":"boolean"
80 },
81 "match":{
82 "description":"Connection matching criteria",
83 "type":"string"
84 },
85 "destinations":{
86 "description":"Destination groups used for routing, by order of preference",
87 "type":"array",
88 "items":{
89 "type":"object",
90 "properties":{
91 "classes":{
92 "description":"Destination group",
93 "type":"array",
94 "items":{
95 "description":"Reference to 'name' entries in the 'destinations' section",
96 "type":"string"
97 }
98 },
99 "strategy":{
100 "description":"Routing strategy that will be used for this route",
101 "type":"string",
102 "enum":[
103 "round-robin",
104 "first-available"
105 ]
106 },
107 "priority":{
108 "description":"Priority of the given group",
109 "type":"integer",
110 "minimum":0
111 }
112 },
113 "required":[
114 "classes",
115 "strategy",
116 "priority"
117 ],
118 "minItems":1,
119 "uniqueItems":true
120 }
121 }
122 },
123 "required":[
124 "name",
125 "match",
126 "destinations"
127 ],
128 "minItems":1,
129 "uniqueItems":true
130 }
131 }
132 },
133 "required":[
134 "version",
135 "destinations",
136 "routes"
137 ],
138 "additionalProperties": false,
139
140 "match_rules":{
141 "keywords":{
142 "type": "array",
143 "items":{
144 "type": "string",
145 "enum": %s
146 }
147 },
148 "functions":{
149 "type": "array",
150 "items":{
151 "type": "string",
152 "enum": %s
153 }
154 },
155 "variables":{
156 "type": "array",
157 "items":{
158 "type": "string",
159 "enum": %s
160 }
161 }
162 }
163})";
164
165#endif // ROUTER_SRC_ROUTING_GUIDELINES_SCHEMA_H_
constexpr const char *const k_routing_guidelines_schema
Definition: guidelines_schema.h:28