Skip to content

Commit 758fc6f

Browse files
committed
Import json schema from old site
1 parent 03d00d6 commit 758fc6f

File tree

3 files changed

+400
-0
lines changed

3 files changed

+400
-0
lines changed
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Changes",
4+
"description": "All data necessary to schedule a node state transition over time and failure domains. Input to the loadchanges() Puppet DSL function.",
5+
"type": "object",
6+
"additionalProperties": true,
7+
"properties": {
8+
"apiVersion": {
9+
"type": "string",
10+
"description": "Represents the desired version of the service API in a request, and the version of the service API that's served in the response. This is not related to the version of the data. Versioning of data should be handled through some other mechanism such as etags. This value is a URI path component."
11+
},
12+
"data": {
13+
"type": "object",
14+
"additionalProperties": true,
15+
"properties": {
16+
"kind": {
17+
"type": "string"
18+
},
19+
"updated": {
20+
"type": "string",
21+
"format": "date-time"
22+
},
23+
"items": {
24+
"type": "array",
25+
"items": {
26+
"$ref": "https://www.openinfrastructure.co/ic/api/v1beta1/schema/change.json#"
27+
}
28+
}
29+
}
30+
}
31+
}
32+
}
+336
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,336 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Change",
4+
"description": "Data necessary to call the ic::change::json() function for a change scheduled over failure domains.",
5+
"type": "object",
6+
"additionalProperties": true,
7+
"required": [
8+
"change",
9+
"schedules"
10+
],
11+
"properties": {
12+
"$schema": {
13+
"type": "string",
14+
"description": "The schema of this representation, intended for vscode and validation.",
15+
"format": "uri"
16+
},
17+
"apiVersion": {
18+
"type": "string",
19+
"description": "The API version which produced this representation. Compatibility hint for consumers."
20+
},
21+
"change": {
22+
"description": "The overall change governing one or more state transitions scheduled over failure domains.",
23+
"type": "object",
24+
"required": [
25+
"data"
26+
],
27+
"additionalProperties": true,
28+
"properties": {
29+
"data": {
30+
"type": "object",
31+
"description": "Data passed to Ic::Change.new()",
32+
"required": [
33+
"change_id",
34+
"pauses"
35+
],
36+
"additionalProperties": false,
37+
"properties": {
38+
"change_id": {
39+
"description": "Unique change identifier. See https://github.com/openinfrastructure/puppet-ic/blob/v0.1.0/types/name.pp",
40+
"type": "string",
41+
"pattern": "^[a-z][a-z0-9_]{0,63}$"
42+
},
43+
"backout": {
44+
"description": "Transitions to the backout state if true",
45+
"type": "boolean",
46+
"default": false
47+
},
48+
"backout_state": {
49+
"description": "The state to enforce of backout is true. Typically state a but a separate backout state may be defined, for example to ensure a file is absent instead of not managed. Possible values are 'a', 'b', or 'backout'",
50+
"type": "string",
51+
"default": "a",
52+
"enum": [
53+
"a",
54+
"b",
55+
"backout"
56+
]
57+
},
58+
"pauses": {
59+
"description": "Array of Pauses during which the rollout is halted.",
60+
"type": "array",
61+
"default": [],
62+
"items": {
63+
"$ref": "#/components/schemas/pause"
64+
}
65+
}
66+
}
67+
}
68+
}
69+
},
70+
"schedules": {
71+
"description": "List of objects used to match nodes to a schedule and failure domains.",
72+
"type": "array",
73+
"items": {
74+
"description": "Associates one Schedule with a Matcher, intended for Puppet to match a node to a schedule during catalog compilation",
75+
"type": "object",
76+
"additionalProperties": true,
77+
"properties": {
78+
"matcher": {
79+
"description": "Match nodes to other things, primarily intended for scheduled failure domains.",
80+
"oneOf": [
81+
{
82+
"$ref": "#/components/schemas/varMatcher"
83+
},
84+
{
85+
"$ref": "#/components/schemas/allMatcher"
86+
}
87+
]
88+
},
89+
"schedule": {
90+
"type": "object",
91+
"description": "Model a Schedule and associated FailureDomains",
92+
"required": [
93+
"data"
94+
],
95+
"additionalProperties": true,
96+
"properties": {
97+
"kind": {
98+
"type": "string",
99+
"enum": [
100+
"default"
101+
],
102+
"default": "default"
103+
},
104+
"data": {
105+
"type": "object",
106+
"description": "Data intended for Ic::Schedule.new",
107+
"required": [
108+
"name"
109+
],
110+
"additionalProperties": false,
111+
"properties": {
112+
"name": {
113+
"type": "string",
114+
"pattern": "^[a-z][a-z0-9_.]{0,63}$"
115+
},
116+
"soak_time": {
117+
"type": "string",
118+
"pattern": "^\\d{2}:\\d{2}:\\d{2}$"
119+
},
120+
"start_time": {
121+
"type": "string",
122+
"format": "date-time"
123+
}
124+
}
125+
}
126+
}
127+
},
128+
"failure_domains": {
129+
"oneOf": [
130+
{
131+
"$ref": "#/components/schemas/membershipFailureDomain"
132+
},
133+
{
134+
"$ref": "#/components/schemas/thresholdFailureDomain"
135+
}
136+
]
137+
}
138+
}
139+
}
140+
}
141+
},
142+
"components": {
143+
"schemas": {
144+
"varMatcher": {
145+
"type": "object",
146+
"example": {
147+
"kind": "var",
148+
"priority": 50,
149+
"data": {
150+
"key": "::aud_dc",
151+
"value": "smf1"
152+
}
153+
},
154+
"required": [
155+
"kind",
156+
"data"
157+
],
158+
"additionalProperties": true,
159+
"properties": {
160+
"kind": {
161+
"type": "string",
162+
"description": "Type hint for Puppet initializer",
163+
"default": "var",
164+
"enum": [
165+
"var"
166+
]
167+
},
168+
"priority": {
169+
"type": "integer",
170+
"description": "Priority of the matcher, 0 is the highest priority.",
171+
"minimum": 0,
172+
"default": 1000
173+
},
174+
"data": {
175+
"type": "object",
176+
"description": "Data passed to Ic::Matcher::Var.new()",
177+
"required": [
178+
"key",
179+
"value"
180+
],
181+
"additionalProperties": false,
182+
"properties": {
183+
"key": {
184+
"type": "string",
185+
"description": "The Puppet DSL variable to check, for example ::aud_dc"
186+
},
187+
"value": {
188+
"description": "The value to compare against key's actual value using the == Puppet equality test, for example 'smf1'"
189+
}
190+
}
191+
}
192+
}
193+
},
194+
"allMatcher": {
195+
"type": "object",
196+
"description": "Match all nodes",
197+
"example": {
198+
"kind": "all",
199+
"priority": 1000
200+
},
201+
"required": [
202+
"kind"
203+
],
204+
"additionalProperties": true,
205+
"properties": {
206+
"kind": {
207+
"type": "string",
208+
"description": "Type hint for Puppet initializer",
209+
"default": "all",
210+
"enum": [
211+
"all"
212+
]
213+
},
214+
"priority": {
215+
"type": "integer",
216+
"description": "Priority of the matcher, 0 is the highest priority.",
217+
"minimum": 0,
218+
"default": 1000
219+
},
220+
"data": {
221+
"type": "object",
222+
"additionalProperties": false
223+
}
224+
}
225+
},
226+
"membershipFailureDomain": {
227+
"type": "object",
228+
"description": "Transition nodes by matching a value associated with the node against a list.",
229+
"required": [
230+
"kind"
231+
],
232+
"additionalProperties": true,
233+
"properties": {
234+
"kind": {
235+
"type": "string",
236+
"default": "membership",
237+
"enum": [
238+
"membership"
239+
]
240+
},
241+
"data": {
242+
"type": "object",
243+
"required": [
244+
"boarding_groups"
245+
],
246+
"additionalProperties": false,
247+
"properties": {
248+
"boarding_groups": {
249+
"type": "array",
250+
"default": [],
251+
"items": {
252+
"type": "array",
253+
"items": {
254+
"type": "string"
255+
}
256+
}
257+
}
258+
}
259+
}
260+
}
261+
},
262+
"thresholdFailureDomain": {
263+
"description": "Transition nodes by assigning each a random number and then increasing a threshold value each period of the rollout.",
264+
"type": "object",
265+
"required": [
266+
"kind",
267+
"data"
268+
],
269+
"additionalProperties": true,
270+
"properties": {
271+
"kind": {
272+
"type": "string",
273+
"default": "threshold",
274+
"enum": [
275+
"threshold"
276+
]
277+
},
278+
"data": {
279+
"type": "object",
280+
"description": "Data passed to Ic::Failure_domains::Threshold.new()",
281+
"required": [
282+
"boarding_groups"
283+
],
284+
"additionalProperties": false,
285+
"properties": {
286+
"boarding_groups": {
287+
"type": "array",
288+
"default": [],
289+
"items": {
290+
"type": "number",
291+
"minimum": 0
292+
}
293+
}
294+
}
295+
}
296+
}
297+
},
298+
"pause": {
299+
"description": "Pause the rollout of a Change. If end_time is null, the rollout is paused indefinitely.",
300+
"type": "object",
301+
"example": {
302+
"data": {
303+
"start_time": "2020-12-03T10:00:00-08:00",
304+
"end_time": "2020-12-03T12:00:00-08:00"
305+
}
306+
},
307+
"required": [
308+
"data"
309+
],
310+
"additionalProperties": true,
311+
"properties": {
312+
"data": {
313+
"type": "object",
314+
"description": "Data intended for Ic::Pause.new()",
315+
"additionalProperties": false,
316+
"required": [
317+
"start_time"
318+
],
319+
"properties": {
320+
"start_time": {
321+
"format": "date-time",
322+
"description": "Required start time when the Change rollout halts",
323+
"type": "string"
324+
},
325+
"end_time": {
326+
"format": "date-time",
327+
"description": "Optional end time when the Change rollout resumes",
328+
"type": "string"
329+
}
330+
}
331+
}
332+
}
333+
}
334+
}
335+
}
336+
}

0 commit comments

Comments
 (0)