fly_io 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +15 -0
  3. data/CONTRIBUTING.md +14 -0
  4. data/LICENSE +21 -0
  5. data/README.md +239 -0
  6. data/Rakefile +30 -0
  7. data/contracts/additional_rest/network_policies.json +94 -0
  8. data/contracts/additional_rest/prometheus.json +103 -0
  9. data/contracts/graphql/fly_go_operations.json +948 -0
  10. data/contracts/graphql/flyctl_named_operations.graphql +316 -0
  11. data/contracts/graphql/flyctl_operations.json +336 -0
  12. data/contracts/graphql/official_examples.json +75 -0
  13. data/contracts/graphql/schema.graphql +10995 -0
  14. data/contracts/graphql/source.json +29 -0
  15. data/contracts/machines/openapi.headers +9 -0
  16. data/contracts/machines/openapi.json +1 -0
  17. data/contracts/machines/source.json +20 -0
  18. data/contracts/public_surface_inventory.json +164 -0
  19. data/contracts/research_metadata.json +17 -0
  20. data/contracts/sources/metrics.html.md +474 -0
  21. data/contracts/sources/network-policies.html.markerb +142 -0
  22. data/docs/API.md +149 -0
  23. data/docs/SURFACES.md +60 -0
  24. data/lib/fly_io/client.rb +52 -0
  25. data/lib/fly_io/configuration.rb +115 -0
  26. data/lib/fly_io/errors.rb +45 -0
  27. data/lib/fly_io/generated/additional_operations.json +123 -0
  28. data/lib/fly_io/generated/graphql_operations.json +1658 -0
  29. data/lib/fly_io/generated/operations.json +6130 -0
  30. data/lib/fly_io/generated/prometheus_operations.json +503 -0
  31. data/lib/fly_io/generated/schemas.json +4237 -0
  32. data/lib/fly_io/graphql_client.rb +103 -0
  33. data/lib/fly_io/model.rb +65 -0
  34. data/lib/fly_io/operation_registry.rb +79 -0
  35. data/lib/fly_io/redactor.rb +34 -0
  36. data/lib/fly_io/resources/base.rb +68 -0
  37. data/lib/fly_io/resources.rb +30 -0
  38. data/lib/fly_io/response.rb +45 -0
  39. data/lib/fly_io/schema_registry.rb +89 -0
  40. data/lib/fly_io/schema_validator.rb +56 -0
  41. data/lib/fly_io/transport.rb +282 -0
  42. data/lib/fly_io/version.rb +5 -0
  43. data/lib/fly_io.rb +23 -0
  44. data/script/check_api_coverage +60 -0
  45. data/script/fetch_openapi +18 -0
  46. data/script/generate_api +302 -0
  47. metadata +197 -0
@@ -0,0 +1,503 @@
1
+ {
2
+ "generated_from": {
3
+ "documentation_url": "https://fly.io/docs/monitoring/metrics",
4
+ "source_revision": "1e8cac5f0fd7a82e66e3b01ece3a10a8ecb2b7e3",
5
+ "source_path": "monitoring/metrics.html.md",
6
+ "source_sha256": "e22d7b34406b16c2ea75eed6cd92c51ec07d166963155623557295ef24f67e9f",
7
+ "retrieved_at": "2026-08-26T21:00:00Z"
8
+ },
9
+ "counts": {
10
+ "endpoint_families": 7,
11
+ "schemas": 1
12
+ },
13
+ "limitations": [
14
+ "This is an observability data API, not a control-plane API.",
15
+ "Fly documents support for most common Prometheus query endpoints and delegates their parameter/response contracts to Prometheus/VictoriaMetrics."
16
+ ],
17
+ "operations": [
18
+ {
19
+ "operation_id": "Prometheus_query",
20
+ "method": "get",
21
+ "path": "/prometheus/{org_slug}/api/v1/query",
22
+ "summary": "Run an instant Prometheus query",
23
+ "parameters": [
24
+ {
25
+ "name": "org_slug",
26
+ "ruby_name": "org_slug",
27
+ "in": "path",
28
+ "required": true,
29
+ "schema": {
30
+ "type": "string"
31
+ }
32
+ },
33
+ {
34
+ "name": "query",
35
+ "ruby_name": "query",
36
+ "in": "query",
37
+ "required": true,
38
+ "schema": {
39
+ "type": "string"
40
+ }
41
+ },
42
+ {
43
+ "name": "time",
44
+ "ruby_name": "time",
45
+ "in": "query",
46
+ "required": false,
47
+ "schema": {
48
+ "type": "string"
49
+ }
50
+ },
51
+ {
52
+ "name": "timeout",
53
+ "ruby_name": "timeout",
54
+ "in": "query",
55
+ "required": false,
56
+ "schema": {
57
+ "type": "string"
58
+ }
59
+ }
60
+ ],
61
+ "identity": "GET /prometheus/{org_slug}/api/v1/query Prometheus_query",
62
+ "surface": "prometheus_metrics",
63
+ "stability": "stable_standard_api_with_qualified_compatibility",
64
+ "base_url": "https://api.fly.io",
65
+ "tags": [
66
+ "Metrics"
67
+ ],
68
+ "request_body": null,
69
+ "responses": {
70
+ "200": {
71
+ "description": "Prometheus API response",
72
+ "content": {
73
+ "application/json": {
74
+ "schema": {
75
+ "$ref": "#/additional/schemas/PrometheusAPIResponse"
76
+ }
77
+ }
78
+ }
79
+ }
80
+ },
81
+ "ruby_resource": "metrics",
82
+ "ruby_method": "query",
83
+ "public_ruby_method": "FlyIO::Client#metrics.query"
84
+ },
85
+ {
86
+ "operation_id": "Prometheus_query_range",
87
+ "method": "get",
88
+ "path": "/prometheus/{org_slug}/api/v1/query_range",
89
+ "summary": "Run a range Prometheus query",
90
+ "parameters": [
91
+ {
92
+ "name": "org_slug",
93
+ "ruby_name": "org_slug",
94
+ "in": "path",
95
+ "required": true,
96
+ "schema": {
97
+ "type": "string"
98
+ }
99
+ },
100
+ {
101
+ "name": "query",
102
+ "ruby_name": "query",
103
+ "in": "query",
104
+ "required": true,
105
+ "schema": {
106
+ "type": "string"
107
+ }
108
+ },
109
+ {
110
+ "name": "start",
111
+ "ruby_name": "start",
112
+ "in": "query",
113
+ "required": true,
114
+ "schema": {
115
+ "type": "string"
116
+ }
117
+ },
118
+ {
119
+ "name": "end",
120
+ "ruby_name": "end",
121
+ "in": "query",
122
+ "required": true,
123
+ "schema": {
124
+ "type": "string"
125
+ }
126
+ },
127
+ {
128
+ "name": "step",
129
+ "ruby_name": "step",
130
+ "in": "query",
131
+ "required": true,
132
+ "schema": {
133
+ "type": "string"
134
+ }
135
+ },
136
+ {
137
+ "name": "timeout",
138
+ "ruby_name": "timeout",
139
+ "in": "query",
140
+ "required": false,
141
+ "schema": {
142
+ "type": "string"
143
+ }
144
+ }
145
+ ],
146
+ "identity": "GET /prometheus/{org_slug}/api/v1/query_range Prometheus_query_range",
147
+ "surface": "prometheus_metrics",
148
+ "stability": "stable_standard_api_with_qualified_compatibility",
149
+ "base_url": "https://api.fly.io",
150
+ "tags": [
151
+ "Metrics"
152
+ ],
153
+ "request_body": null,
154
+ "responses": {
155
+ "200": {
156
+ "description": "Prometheus API response",
157
+ "content": {
158
+ "application/json": {
159
+ "schema": {
160
+ "$ref": "#/additional/schemas/PrometheusAPIResponse"
161
+ }
162
+ }
163
+ }
164
+ }
165
+ },
166
+ "ruby_resource": "metrics",
167
+ "ruby_method": "query_range",
168
+ "public_ruby_method": "FlyIO::Client#metrics.query_range"
169
+ },
170
+ {
171
+ "operation_id": "Prometheus_series",
172
+ "method": "get",
173
+ "path": "/prometheus/{org_slug}/api/v1/series",
174
+ "summary": "Find series by label matchers",
175
+ "parameters": [
176
+ {
177
+ "name": "org_slug",
178
+ "ruby_name": "org_slug",
179
+ "in": "path",
180
+ "required": true,
181
+ "schema": {
182
+ "type": "string"
183
+ }
184
+ },
185
+ {
186
+ "name": "match[]",
187
+ "ruby_name": "match",
188
+ "in": "query",
189
+ "required": true,
190
+ "schema": {
191
+ "type": "array",
192
+ "items": {
193
+ "type": "string"
194
+ }
195
+ }
196
+ },
197
+ {
198
+ "name": "start",
199
+ "ruby_name": "start",
200
+ "in": "query",
201
+ "required": false,
202
+ "schema": {
203
+ "type": "string"
204
+ }
205
+ },
206
+ {
207
+ "name": "end",
208
+ "ruby_name": "end",
209
+ "in": "query",
210
+ "required": false,
211
+ "schema": {
212
+ "type": "string"
213
+ }
214
+ }
215
+ ],
216
+ "identity": "GET /prometheus/{org_slug}/api/v1/series Prometheus_series",
217
+ "surface": "prometheus_metrics",
218
+ "stability": "stable_standard_api_with_qualified_compatibility",
219
+ "base_url": "https://api.fly.io",
220
+ "tags": [
221
+ "Metrics"
222
+ ],
223
+ "request_body": null,
224
+ "responses": {
225
+ "200": {
226
+ "description": "Prometheus API response",
227
+ "content": {
228
+ "application/json": {
229
+ "schema": {
230
+ "$ref": "#/additional/schemas/PrometheusAPIResponse"
231
+ }
232
+ }
233
+ }
234
+ }
235
+ },
236
+ "ruby_resource": "metrics",
237
+ "ruby_method": "series",
238
+ "public_ruby_method": "FlyIO::Client#metrics.series"
239
+ },
240
+ {
241
+ "operation_id": "Prometheus_labels",
242
+ "method": "get",
243
+ "path": "/prometheus/{org_slug}/api/v1/labels",
244
+ "summary": "Get label names",
245
+ "parameters": [
246
+ {
247
+ "name": "org_slug",
248
+ "ruby_name": "org_slug",
249
+ "in": "path",
250
+ "required": true,
251
+ "schema": {
252
+ "type": "string"
253
+ }
254
+ },
255
+ {
256
+ "name": "match[]",
257
+ "ruby_name": "match",
258
+ "in": "query",
259
+ "required": false,
260
+ "schema": {
261
+ "type": "array",
262
+ "items": {
263
+ "type": "string"
264
+ }
265
+ }
266
+ },
267
+ {
268
+ "name": "start",
269
+ "ruby_name": "start",
270
+ "in": "query",
271
+ "required": false,
272
+ "schema": {
273
+ "type": "string"
274
+ }
275
+ },
276
+ {
277
+ "name": "end",
278
+ "ruby_name": "end",
279
+ "in": "query",
280
+ "required": false,
281
+ "schema": {
282
+ "type": "string"
283
+ }
284
+ }
285
+ ],
286
+ "identity": "GET /prometheus/{org_slug}/api/v1/labels Prometheus_labels",
287
+ "surface": "prometheus_metrics",
288
+ "stability": "stable_standard_api_with_qualified_compatibility",
289
+ "base_url": "https://api.fly.io",
290
+ "tags": [
291
+ "Metrics"
292
+ ],
293
+ "request_body": null,
294
+ "responses": {
295
+ "200": {
296
+ "description": "Prometheus API response",
297
+ "content": {
298
+ "application/json": {
299
+ "schema": {
300
+ "$ref": "#/additional/schemas/PrometheusAPIResponse"
301
+ }
302
+ }
303
+ }
304
+ }
305
+ },
306
+ "ruby_resource": "metrics",
307
+ "ruby_method": "labels",
308
+ "public_ruby_method": "FlyIO::Client#metrics.labels"
309
+ },
310
+ {
311
+ "operation_id": "Prometheus_label_values",
312
+ "method": "get",
313
+ "path": "/prometheus/{org_slug}/api/v1/label/{label_name}/values",
314
+ "summary": "Get values for a label",
315
+ "parameters": [
316
+ {
317
+ "name": "org_slug",
318
+ "ruby_name": "org_slug",
319
+ "in": "path",
320
+ "required": true,
321
+ "schema": {
322
+ "type": "string"
323
+ }
324
+ },
325
+ {
326
+ "name": "label_name",
327
+ "ruby_name": "label_name",
328
+ "in": "path",
329
+ "required": true,
330
+ "schema": {
331
+ "type": "string"
332
+ }
333
+ },
334
+ {
335
+ "name": "match[]",
336
+ "ruby_name": "match",
337
+ "in": "query",
338
+ "required": false,
339
+ "schema": {
340
+ "type": "array",
341
+ "items": {
342
+ "type": "string"
343
+ }
344
+ }
345
+ },
346
+ {
347
+ "name": "start",
348
+ "ruby_name": "start",
349
+ "in": "query",
350
+ "required": false,
351
+ "schema": {
352
+ "type": "string"
353
+ }
354
+ },
355
+ {
356
+ "name": "end",
357
+ "ruby_name": "end",
358
+ "in": "query",
359
+ "required": false,
360
+ "schema": {
361
+ "type": "string"
362
+ }
363
+ }
364
+ ],
365
+ "identity": "GET /prometheus/{org_slug}/api/v1/label/{label_name}/values Prometheus_label_values",
366
+ "surface": "prometheus_metrics",
367
+ "stability": "stable_standard_api_with_qualified_compatibility",
368
+ "base_url": "https://api.fly.io",
369
+ "tags": [
370
+ "Metrics"
371
+ ],
372
+ "request_body": null,
373
+ "responses": {
374
+ "200": {
375
+ "description": "Prometheus API response",
376
+ "content": {
377
+ "application/json": {
378
+ "schema": {
379
+ "$ref": "#/additional/schemas/PrometheusAPIResponse"
380
+ }
381
+ }
382
+ }
383
+ }
384
+ },
385
+ "ruby_resource": "metrics",
386
+ "ruby_method": "label_values",
387
+ "public_ruby_method": "FlyIO::Client#metrics.label_values"
388
+ },
389
+ {
390
+ "operation_id": "Prometheus_tsdb",
391
+ "method": "get",
392
+ "path": "/prometheus/{org_slug}/api/v1/status/tsdb",
393
+ "summary": "Get TSDB statistics",
394
+ "parameters": [
395
+ {
396
+ "name": "org_slug",
397
+ "ruby_name": "org_slug",
398
+ "in": "path",
399
+ "required": true,
400
+ "schema": {
401
+ "type": "string"
402
+ }
403
+ },
404
+ {
405
+ "name": "limit",
406
+ "ruby_name": "limit",
407
+ "in": "query",
408
+ "required": false,
409
+ "schema": {
410
+ "type": "integer"
411
+ }
412
+ },
413
+ {
414
+ "name": "match[]",
415
+ "ruby_name": "match",
416
+ "in": "query",
417
+ "required": false,
418
+ "schema": {
419
+ "type": "array",
420
+ "items": {
421
+ "type": "string"
422
+ }
423
+ }
424
+ }
425
+ ],
426
+ "identity": "GET /prometheus/{org_slug}/api/v1/status/tsdb Prometheus_tsdb",
427
+ "surface": "prometheus_metrics",
428
+ "stability": "stable_standard_api_with_qualified_compatibility",
429
+ "base_url": "https://api.fly.io",
430
+ "tags": [
431
+ "Metrics"
432
+ ],
433
+ "request_body": null,
434
+ "responses": {
435
+ "200": {
436
+ "description": "Prometheus API response",
437
+ "content": {
438
+ "application/json": {
439
+ "schema": {
440
+ "$ref": "#/additional/schemas/PrometheusAPIResponse"
441
+ }
442
+ }
443
+ }
444
+ }
445
+ },
446
+ "ruby_resource": "metrics",
447
+ "ruby_method": "tsdb",
448
+ "public_ruby_method": "FlyIO::Client#metrics.tsdb"
449
+ },
450
+ {
451
+ "operation_id": "Prometheus_federate",
452
+ "method": "get",
453
+ "path": "/prometheus/{org_slug}/federate",
454
+ "summary": "Federate selected metrics",
455
+ "parameters": [
456
+ {
457
+ "name": "org_slug",
458
+ "ruby_name": "org_slug",
459
+ "in": "path",
460
+ "required": true,
461
+ "schema": {
462
+ "type": "string"
463
+ }
464
+ },
465
+ {
466
+ "name": "match[]",
467
+ "ruby_name": "match",
468
+ "in": "query",
469
+ "required": true,
470
+ "schema": {
471
+ "type": "array",
472
+ "items": {
473
+ "type": "string"
474
+ }
475
+ }
476
+ }
477
+ ],
478
+ "identity": "GET /prometheus/{org_slug}/federate Prometheus_federate",
479
+ "surface": "prometheus_metrics",
480
+ "stability": "stable_standard_api_with_qualified_compatibility",
481
+ "base_url": "https://api.fly.io",
482
+ "tags": [
483
+ "Metrics"
484
+ ],
485
+ "request_body": null,
486
+ "responses": {
487
+ "200": {
488
+ "description": "Prometheus API response",
489
+ "content": {
490
+ "text/plain": {
491
+ "schema": {
492
+ "type": "string"
493
+ }
494
+ }
495
+ }
496
+ }
497
+ },
498
+ "ruby_resource": "metrics",
499
+ "ruby_method": "federate",
500
+ "public_ruby_method": "FlyIO::Client#metrics.federate"
501
+ }
502
+ ]
503
+ }