Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
2713 lines (2697 loc) · 87.5 KB
/
Copy pathopenapi.yaml
File metadata and controls
2713 lines (2697 loc) · 87.5 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: sitewarm public API
version: 0.1.0
summary: Manage sites, warm runs, schedules, webhooks and API keys of the hosted sitewarm service.
description: |
This document is the source of truth for the public REST API; the server, the SDKs and the contract
tests are built from it.
## Vocabulary
A **site** is one hostname. A **vantage
point** is the place a run's requests are sent from (`region` is an attribute of it). The
**cache status** of a URL is one of the normalized states in `CacheState`; `GET` results also carry
the raw CDN header value untouched in `cdn_cache_header`. Indexability is a separate field, never a
cache state.
## Conventions
- **Versioning.** The base path is `/v1`. Breaking changes need a new major path.
- **Authentication.** Every operation takes a scoped API key as a bearer token
(`Authorization: Bearer <key>`). Session cookies are never accepted. Each operation lists the
scope it needs. A request for a resource of another organization returns `404`, not `403`.
- **Idempotency.** Send `Idempotency-Key` on `POST`. Repeating a request with the same key and the
same body returns the first response and sets `Idempotent-Replayed: true`. The same key with a
different body is a `409` problem of type `idempotency-key-reused`. The warm-run trigger requires
the header; the other `POST` operations accept it.
- **Pagination.** Lists use opaque cursors: pass `cursor` from `page.next_cursor` of the previous
page. Clients must not parse cursors.
- **Errors.** Every error is `application/problem+json` as in RFC 9457. The `type` member is a URI
reference naming one of the problem types listed in `ProblemType`.
- **Rate limits.** Every response except `500` carries `RateLimit-Limit`, `RateLimit-Remaining` and
`RateLimit-Reset`. A `429` also carries `Retry-After`.
- **Async work.** Starting a warm run answers `202 Accepted` with a `Location` header pointing at
the warm-run resource, which is the status resource to poll. Cancelling is also asynchronous.
- **Webhooks.** Events are delivered with an HMAC-SHA256 signature, see the `webhooks` section.
- **Time and ids.** Timestamps are RFC 3339 UTC. Ids are opaque strings. Durations are strings
such as `10s` or `5m`, as in the CLI.
- **Sensitive data.** The API never returns `Cookie`, `Set-Cookie` or `Authorization` values from a
customer site, and never accepts them. Header names such as `Cache-Control`, `Age` and `Vary`
are returned as observed.
- **Safety.** A site must be verified before any run. Triggering a run for an unverified
or paused site is rejected with a problem.
contact:
name: sitewarm
url: https://github.com/sitewarm
license:
name: Apache-2.0
identifier: Apache-2.0
servers:
- url: /api/v1
description: |
Relative to the host that serves the API.
tags:
- name: Sites
description: Hostnames the organization owns, and their sitemaps and URL sets.
- name: Warm runs
description: Warm and verify runs, their status and their results.
- name: Cache status reports
description: Cache status per route group and vantage point, derived from warm runs.
- name: Schedules
description: Recurring warm runs.
- name: Webhooks
description: Outbound event subscriptions signed with HMAC.
- name: API keys
description: Scoped credentials for this API.
security:
- ApiKey: []
paths:
/sites:
get:
operationId: listSites
summary: List sites
tags: [Sites]
security:
- ApiKey: [sites:read]
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/Limit'
responses:
'200':
description: A page of sites.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/SiteList'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
post:
operationId: createSite
summary: Create a site
description: |
Creates an unverified site. Verification is done outside this API; until it passes, runs for
the site are rejected (`site-not-verified`). A site is one hostname: the apex and its `www` are
the same site.
tags: [Sites]
security:
- ApiKey: [sites:write]
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SiteCreate'
responses:
'201':
description: The site was created.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
Location:
$ref: '#/components/headers/Location'
Idempotent-Replayed:
$ref: '#/components/headers/IdempotentReplayed'
content:
application/json:
schema:
$ref: '#/components/schemas/Site'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'409':
$ref: '#/components/responses/Conflict'
'422':
$ref: '#/components/responses/Unprocessable'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/sites/{siteId}:
parameters:
- $ref: '#/components/parameters/SiteId'
get:
operationId: getSite
summary: Get a site
tags: [Sites]
security:
- ApiKey: [sites:read]
responses:
'200':
description: The site.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/Site'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
patch:
operationId: updateSite
summary: Update site settings
tags: [Sites]
security:
- ApiKey: [sites:write]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SiteUpdate'
responses:
'200':
description: The updated site.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/Site'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/Unprocessable'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
delete:
operationId: deleteSite
summary: Delete a site and its history
description: Deletes the site, its sitemaps, URL sets, schedules and stored results.
tags: [Sites]
security:
- ApiKey: [sites:write]
responses:
'204':
description: The site was deleted.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/sites/{siteId}/sitemaps:
parameters:
- $ref: '#/components/parameters/SiteId'
get:
operationId: listSitemaps
summary: List the sitemaps of a site
tags: [Sites]
security:
- ApiKey: [sites:read]
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/Limit'
responses:
'200':
description: A page of sitemaps.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/SitemapList'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
post:
operationId: createSitemap
summary: Register a sitemap
description: The sitemap URL must be on the site's hostname. Sitemap indexes and `.gz` files are accepted.
tags: [Sites]
security:
- ApiKey: [sites:write]
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SitemapCreate'
responses:
'201':
description: The sitemap was registered.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
Location:
$ref: '#/components/headers/Location'
Idempotent-Replayed:
$ref: '#/components/headers/IdempotentReplayed'
content:
application/json:
schema:
$ref: '#/components/schemas/Sitemap'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'422':
$ref: '#/components/responses/Unprocessable'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/sites/{siteId}/sitemaps/{sitemapId}:
parameters:
- $ref: '#/components/parameters/SiteId'
- $ref: '#/components/parameters/SitemapId'
get:
operationId: getSitemap
summary: Get a sitemap
tags: [Sites]
security:
- ApiKey: [sites:read]
responses:
'200':
description: The sitemap.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/Sitemap'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
delete:
operationId: deleteSitemap
summary: Remove a sitemap
tags: [Sites]
security:
- ApiKey: [sites:write]
responses:
'204':
description: The sitemap was removed.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/sites/{siteId}/url-sets:
parameters:
- $ref: '#/components/parameters/SiteId'
get:
operationId: listUrlSets
summary: List the URL sets of a site
description: |
A URL set is an explicit, ordered list of URLs, the hosted equivalent of the CLI's `--top-from`
file. The order is the warming priority.
tags: [Sites]
security:
- ApiKey: [sites:read]
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/Limit'
responses:
'200':
description: A page of URL sets (without their URLs).
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/UrlSetList'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
post:
operationId: createUrlSet
summary: Create a URL set
tags: [Sites]
security:
- ApiKey: [sites:write]
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UrlSetWrite'
responses:
'201':
description: The URL set was created.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
Location:
$ref: '#/components/headers/Location'
Idempotent-Replayed:
$ref: '#/components/headers/IdempotentReplayed'
content:
application/json:
schema:
$ref: '#/components/schemas/UrlSet'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'422':
$ref: '#/components/responses/Unprocessable'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/sites/{siteId}/url-sets/{urlSetId}:
parameters:
- $ref: '#/components/parameters/SiteId'
- $ref: '#/components/parameters/UrlSetId'
get:
operationId: getUrlSet
summary: Get a URL set with its URLs
tags: [Sites]
security:
- ApiKey: [sites:read]
responses:
'200':
description: The URL set.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/UrlSet'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
put:
operationId: replaceUrlSet
summary: Replace a URL set
tags: [Sites]
security:
- ApiKey: [sites:write]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UrlSetWrite'
responses:
'200':
description: The replaced URL set.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/UrlSet'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/Unprocessable'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
delete:
operationId: deleteUrlSet
summary: Delete a URL set
tags: [Sites]
security:
- ApiKey: [sites:write]
responses:
'204':
description: The URL set was deleted.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/sites/{siteId}/warm-runs:
parameters:
- $ref: '#/components/parameters/SiteId'
get:
operationId: listWarmRuns
summary: List warm runs of a site
tags: [Warm runs]
security:
- ApiKey: [warm-runs:read]
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/Limit'
- name: status
in: query
description: Only runs in this lifecycle status.
schema:
$ref: '#/components/schemas/RunStatus'
- name: trigger_type
in: query
description: Only runs started this way.
schema:
$ref: '#/components/schemas/TriggerType'
responses:
'200':
description: A page of warm runs, newest first.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/WarmRunList'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
post:
operationId: createWarmRun
summary: Start a warm run (for example after a deploy)
description: |
Queues a run that warms and verifies the URLs of one source, from the vantage points the
organization is entitled to, and answers `202`. Poll `GET /warm-runs/{runId}` (the `Location`
header) until `status` is `completed` or `canceled`, then read `outcome` and the results.
The run is rejected if the site is not verified (`site-not-verified`), is paused (`site-paused`),
or the organization is over a limit (`quota-exceeded`).
`source` may be omitted: the run then warms the URLs of the site's discovered sitemaps
(`robots.txt` and `/sitemap.xml`). In the current implementation `source` of type `sitemap` or
`url_set`, `vantage_point_ids` and every option other than `top` and `fail_on` answer `422`
(`validation-failed`) with a JSON Pointer; they are never ignored silently. Only one run per
site may be queued or running (`conflict`).
`Idempotency-Key` is required: a retried trigger from CI must not start a second run.
tags: [Warm runs]
security:
- ApiKey: [warm-runs:write]
parameters:
- $ref: '#/components/parameters/IdempotencyKeyRequired'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WarmRunCreate'
examples:
afterDeploy:
summary: Warm the sitemap after a production deploy
value:
source:
type: sitemap
sitemap_id: sm_example
deployment:
id: deploy-1234
environment: production
ref: 0123abcd
options:
fail_on: [miss, error, noindex]
responses:
'202':
description: The run was accepted and queued.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
Location:
$ref: '#/components/headers/Location'
Retry-After:
$ref: '#/components/headers/RetryAfter'
Idempotent-Replayed:
$ref: '#/components/headers/IdempotentReplayed'
content:
application/json:
schema:
$ref: '#/components/schemas/WarmRun'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'422':
$ref: '#/components/responses/Unprocessable'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/warm-runs/{runId}:
parameters:
- $ref: '#/components/parameters/RunId'
get:
operationId: getWarmRun
summary: Get a warm run (status resource)
description: |
While the run is `queued` or `running` the response carries `Retry-After` with the suggested
polling delay. `outcome` is null until the run is `completed`.
tags: [Warm runs]
security:
- ApiKey: [warm-runs:read]
responses:
'200':
description: The warm run, with a per-vantage-point summary.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
Retry-After:
$ref: '#/components/headers/RetryAfter'
content:
application/json:
schema:
$ref: '#/components/schemas/WarmRun'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/warm-runs/{runId}/cancel:
parameters:
- $ref: '#/components/parameters/RunId'
post:
operationId: cancelWarmRun
summary: Cancel a warm run
description: |
Asks the vantage points to stop. URLs not requested yet are recorded as `incomplete`. Answers
`202`; the run becomes `canceled` once every vantage point has stopped. Cancelling a run that is
already `completed` or `canceled` is a no-op that returns `202` with the current state.
tags: [Warm runs]
security:
- ApiKey: [warm-runs:write]
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
responses:
'202':
description: Cancellation was requested.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
Location:
$ref: '#/components/headers/Location'
Retry-After:
$ref: '#/components/headers/RetryAfter'
Idempotent-Replayed:
$ref: '#/components/headers/IdempotentReplayed'
content:
application/json:
schema:
$ref: '#/components/schemas/WarmRun'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/warm-runs/{runId}/results:
parameters:
- $ref: '#/components/parameters/RunId'
get:
operationId: listWarmRunResults
summary: List per-URL results of a warm run
description: |
One result per URL, profile and vantage point. Results of a run that is still in progress are
partial and may change until the run is `completed`.
tags: [Warm runs]
security:
- ApiKey: [warm-runs:read]
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/Limit'
- name: final_state
in: query
description: Only results whose final cache status is this state.
schema:
$ref: '#/components/schemas/CacheState'
- name: vantage_point_id
in: query
description: Only results observed from this vantage point.
schema:
type: string
- name: profile
in: query
description: Only results for this request profile (for example `desktop` or `mobile`).
schema:
type: string
- name: url
in: query
description: Only the results of this exact URL.
schema:
type: string
format: uri
- name: route_group
in: query
description: Only results in this route group.
schema:
type: string
responses:
'200':
description: A page of results.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/ResultList'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/sites/{siteId}/cache-status-reports:
parameters:
- $ref: '#/components/parameters/SiteId'
get:
operationId: listCacheStatusReports
summary: List cache status reports of a site
description: One report per completed warm run, newest first.
tags: [Cache status reports]
security:
- ApiKey: [cache-reports:read]
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/Limit'
- name: warm_run_id
in: query
description: Only the report of this warm run.
schema:
type: string
responses:
'200':
description: A page of report summaries (without cells).
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/CacheStatusReportList'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/cache-status-reports/{reportId}:
parameters:
- $ref: '#/components/parameters/ReportId'
get:
operationId: getCacheStatusReport
summary: Get a cache status report
tags: [Cache status reports]
security:
- ApiKey: [cache-reports:read]
responses:
'200':
description: The report, with one cell per route group and vantage point.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/CacheStatusReport'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/sites/{siteId}/schedules:
parameters:
- $ref: '#/components/parameters/SiteId'
get:
operationId: listSchedules
summary: List schedules of a site
tags: [Schedules]
security:
- ApiKey: [schedules:read]
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/Limit'
responses:
'200':
description: A page of schedules.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/ScheduleList'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
post:
operationId: createSchedule
summary: Create a schedule
description: The cadence is validated against the organization's limits (`quota-exceeded`).
tags: [Schedules]
security:
- ApiKey: [schedules:write]
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema: