@cronicorn/mcp-server 1.21.0 → 1.22.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.
- package/README.md +17 -7
- package/dist/docs/api-reference.md +38 -38
- package/dist/docs/automated-error-recovery.md +8 -8
- package/dist/docs/code-examples.md +4 -4
- package/dist/docs/core-concepts.md +6 -6
- package/dist/docs/introduction.md +45 -30
- package/dist/docs/mcp-server.md +30 -28
- package/dist/docs/quick-start.md +2 -2
- package/dist/docs/recipes.md +27 -27
- package/dist/docs/self-hosting/_category.yml +8 -0
- package/dist/docs/self-hosting/backup-restore.md +127 -0
- package/dist/docs/self-hosting/configuration.md +185 -0
- package/dist/docs/self-hosting/index.md +162 -0
- package/dist/docs/self-hosting/known-limitations.md +72 -0
- package/dist/docs/self-hosting/monitoring.md +177 -0
- package/dist/docs/self-hosting/reverse-proxy.md +283 -0
- package/dist/docs/self-hosting/troubleshooting.md +274 -0
- package/dist/docs/self-hosting/upgrading.md +119 -0
- package/dist/docs/technical/coordinating-multiple-endpoints.md +22 -22
- package/dist/docs/troubleshooting.md +3 -44
- package/dist/docs/use-cases.md +11 -11
- package/dist/index.js +37 -634
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/docs/self-hosting.md +0 -172
package/README.md
CHANGED
|
@@ -2,7 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@cronicorn/mcp-server)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Manage cron jobs by talking to your AI assistant.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
You: "Check my API health every 5 minutes"
|
|
9
|
+
AI: ✅ Created job with health check running every 5 minutes.
|
|
10
|
+
|
|
11
|
+
You: "Help me migrate my app's scheduling to Cronicorn"
|
|
12
|
+
AI: I found 3 cron jobs in your codebase. Here's how to move each one...
|
|
13
|
+
|
|
14
|
+
You: "Give me 5 profitable SaaS ideas built on Cronicorn"
|
|
15
|
+
AI: Based on Cronicorn's adaptive scheduling and AI capabilities...
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Works with Claude, GitHub Copilot, Cursor, Cline, Continue, and any MCP-compatible assistant.
|
|
6
19
|
|
|
7
20
|
## Setup
|
|
8
21
|
|
|
@@ -125,14 +138,11 @@ Tokens are valid for 30 days. Re-authentication is automatic when expired.
|
|
|
125
138
|
| `getEndpointHealth` | Get health summary |
|
|
126
139
|
| `getDashboardStats` | Get account-wide stats |
|
|
127
140
|
|
|
128
|
-
##
|
|
141
|
+
## Documentation Resources
|
|
129
142
|
|
|
130
|
-
|
|
143
|
+
The server bundles comprehensive docs as MCP resources — concepts, recipes, API reference, troubleshooting, and self-hosting guides. AI assistants read these automatically to answer questions about Cronicorn.
|
|
131
144
|
|
|
132
|
-
|
|
133
|
-
|--------|-------------|
|
|
134
|
-
| `/setup-first-job` | Step-by-step guide for creating your first job |
|
|
135
|
-
| `/troubleshoot-failures` | Debug failing endpoints |
|
|
145
|
+
For conversational examples and detailed tool call walkthroughs, see the [full docs](https://docs.cronicorn.com/mcp-server).
|
|
136
146
|
|
|
137
147
|
## Updating
|
|
138
148
|
|
|
@@ -16,7 +16,7 @@ mcp:
|
|
|
16
16
|
|
|
17
17
|
# API Reference
|
|
18
18
|
|
|
19
|
-
**TL;DR:** Access Cronicorn programmatically using API keys (`x-api-key` header) or bearer tokens (OAuth device flow). Base URL is your API host (e.g., `https://
|
|
19
|
+
**TL;DR:** Access Cronicorn programmatically using API keys (`x-api-key` header) or bearer tokens (OAuth device flow). Base URL is your API host (e.g., `https://cronicorn.com` or `http://localhost:3333`).
|
|
20
20
|
|
|
21
21
|
## API Documentation Formats
|
|
22
22
|
|
|
@@ -37,7 +37,7 @@ Generate API keys in the web UI at `/settings/api-keys`.
|
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
curl -H "x-api-key: cron_abc123..." \
|
|
40
|
-
https://
|
|
40
|
+
https://cronicorn.com/api/jobs
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
### Bearer Tokens (OAuth Device Flow)
|
|
@@ -46,7 +46,7 @@ For CLI tools and AI agents:
|
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
# 1. Request device code
|
|
49
|
-
curl -X POST https://
|
|
49
|
+
curl -X POST https://cronicorn.com/api/auth/device/code
|
|
50
50
|
|
|
51
51
|
# Response:
|
|
52
52
|
{
|
|
@@ -59,7 +59,7 @@ curl -X POST https://api.cronicorn.com/api/auth/device/code
|
|
|
59
59
|
# 2. User authorizes in browser
|
|
60
60
|
|
|
61
61
|
# 3. Poll for token
|
|
62
|
-
curl -X POST https://
|
|
62
|
+
curl -X POST https://cronicorn.com/api/auth/device/token \
|
|
63
63
|
-H "Content-Type: application/json" \
|
|
64
64
|
-d '{"device_code": "DEVICE_CODE"}'
|
|
65
65
|
|
|
@@ -72,7 +72,7 @@ curl -X POST https://api.cronicorn.com/api/auth/device/token \
|
|
|
72
72
|
|
|
73
73
|
# 4. Use in requests
|
|
74
74
|
curl -H "Authorization: Bearer eyJ..." \
|
|
75
|
-
https://
|
|
75
|
+
https://cronicorn.com/api/jobs
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
---
|
|
@@ -82,7 +82,7 @@ curl -H "Authorization: Bearer eyJ..." \
|
|
|
82
82
|
### Create Job
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
curl -X POST https://
|
|
85
|
+
curl -X POST https://cronicorn.com/api/jobs \
|
|
86
86
|
-H "x-api-key: YOUR_API_KEY" \
|
|
87
87
|
-H "Content-Type: application/json" \
|
|
88
88
|
-d '{
|
|
@@ -106,7 +106,7 @@ curl -X POST https://api.cronicorn.com/api/jobs \
|
|
|
106
106
|
|
|
107
107
|
```bash
|
|
108
108
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
109
|
-
"https://
|
|
109
|
+
"https://cronicorn.com/api/jobs?status=active"
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
**Query Parameters:**
|
|
@@ -116,13 +116,13 @@ curl -H "x-api-key: YOUR_API_KEY" \
|
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
118
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
119
|
-
https://
|
|
119
|
+
https://cronicorn.com/api/jobs/job_abc123
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
### Update Job
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
|
-
curl -X PATCH https://
|
|
125
|
+
curl -X PATCH https://cronicorn.com/api/jobs/job_abc123 \
|
|
126
126
|
-H "x-api-key: YOUR_API_KEY" \
|
|
127
127
|
-H "Content-Type: application/json" \
|
|
128
128
|
-d '{
|
|
@@ -134,21 +134,21 @@ curl -X PATCH https://api.cronicorn.com/api/jobs/job_abc123 \
|
|
|
134
134
|
### Archive Job
|
|
135
135
|
|
|
136
136
|
```bash
|
|
137
|
-
curl -X POST https://
|
|
137
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/archive \
|
|
138
138
|
-H "x-api-key: YOUR_API_KEY"
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
### Pause Job
|
|
142
142
|
|
|
143
143
|
```bash
|
|
144
|
-
curl -X POST https://
|
|
144
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/pause \
|
|
145
145
|
-H "x-api-key: YOUR_API_KEY"
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
### Resume Job
|
|
149
149
|
|
|
150
150
|
```bash
|
|
151
|
-
curl -X POST https://
|
|
151
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/resume \
|
|
152
152
|
-H "x-api-key: YOUR_API_KEY"
|
|
153
153
|
```
|
|
154
154
|
|
|
@@ -159,7 +159,7 @@ curl -X POST https://api.cronicorn.com/api/jobs/job_abc123/resume \
|
|
|
159
159
|
### Add Endpoint
|
|
160
160
|
|
|
161
161
|
```bash
|
|
162
|
-
curl -X POST https://
|
|
162
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/endpoints \
|
|
163
163
|
-H "x-api-key: YOUR_API_KEY" \
|
|
164
164
|
-H "Content-Type: application/json" \
|
|
165
165
|
-d '{
|
|
@@ -195,20 +195,20 @@ curl -X POST https://api.cronicorn.com/api/jobs/job_abc123/endpoints \
|
|
|
195
195
|
|
|
196
196
|
```bash
|
|
197
197
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
198
|
-
https://
|
|
198
|
+
https://cronicorn.com/api/jobs/job_abc123/endpoints
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
### Get Endpoint
|
|
202
202
|
|
|
203
203
|
```bash
|
|
204
204
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
205
|
-
https://
|
|
205
|
+
https://cronicorn.com/api/jobs/job_abc123/endpoints/ep_xyz789
|
|
206
206
|
```
|
|
207
207
|
|
|
208
208
|
### Update Endpoint
|
|
209
209
|
|
|
210
210
|
```bash
|
|
211
|
-
curl -X PATCH https://
|
|
211
|
+
curl -X PATCH https://cronicorn.com/api/jobs/job_abc123/endpoints/ep_xyz789 \
|
|
212
212
|
-H "x-api-key: YOUR_API_KEY" \
|
|
213
213
|
-H "Content-Type: application/json" \
|
|
214
214
|
-d '{
|
|
@@ -220,7 +220,7 @@ curl -X PATCH https://api.cronicorn.com/api/jobs/job_abc123/endpoints/ep_xyz789
|
|
|
220
220
|
### Archive Endpoint
|
|
221
221
|
|
|
222
222
|
```bash
|
|
223
|
-
curl -X POST https://
|
|
223
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/endpoints/ep_xyz789/archive \
|
|
224
224
|
-H "x-api-key: YOUR_API_KEY"
|
|
225
225
|
```
|
|
226
226
|
|
|
@@ -228,7 +228,7 @@ curl -X POST https://api.cronicorn.com/api/jobs/job_abc123/endpoints/ep_xyz789/a
|
|
|
228
228
|
|
|
229
229
|
```bash
|
|
230
230
|
# Pause until specific time
|
|
231
|
-
curl -X POST https://
|
|
231
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/pause \
|
|
232
232
|
-H "x-api-key: YOUR_API_KEY" \
|
|
233
233
|
-H "Content-Type: application/json" \
|
|
234
234
|
-d '{
|
|
@@ -237,7 +237,7 @@ curl -X POST https://api.cronicorn.com/api/endpoints/ep_xyz789/pause \
|
|
|
237
237
|
}'
|
|
238
238
|
|
|
239
239
|
# Resume immediately
|
|
240
|
-
curl -X POST https://
|
|
240
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/pause \
|
|
241
241
|
-H "x-api-key: YOUR_API_KEY" \
|
|
242
242
|
-H "Content-Type: application/json" \
|
|
243
243
|
-d '{
|
|
@@ -255,7 +255,7 @@ curl -X POST https://api.cronicorn.com/api/endpoints/ep_xyz789/pause \
|
|
|
255
255
|
Temporarily adjust execution frequency:
|
|
256
256
|
|
|
257
257
|
```bash
|
|
258
|
-
curl -X POST https://
|
|
258
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/hints/interval \
|
|
259
259
|
-H "x-api-key: YOUR_API_KEY" \
|
|
260
260
|
-H "Content-Type: application/json" \
|
|
261
261
|
-d '{
|
|
@@ -270,7 +270,7 @@ curl -X POST https://api.cronicorn.com/api/endpoints/ep_xyz789/hints/interval \
|
|
|
270
270
|
Trigger a specific one-time execution:
|
|
271
271
|
|
|
272
272
|
```bash
|
|
273
|
-
curl -X POST https://
|
|
273
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/hints/oneshot \
|
|
274
274
|
-H "x-api-key: YOUR_API_KEY" \
|
|
275
275
|
-H "Content-Type: application/json" \
|
|
276
276
|
-d '{
|
|
@@ -285,7 +285,7 @@ curl -X POST https://api.cronicorn.com/api/endpoints/ep_xyz789/hints/oneshot \
|
|
|
285
285
|
Reset to baseline schedule:
|
|
286
286
|
|
|
287
287
|
```bash
|
|
288
|
-
curl -X DELETE https://
|
|
288
|
+
curl -X DELETE https://cronicorn.com/api/endpoints/ep_xyz789/hints \
|
|
289
289
|
-H "x-api-key: YOUR_API_KEY"
|
|
290
290
|
```
|
|
291
291
|
|
|
@@ -294,7 +294,7 @@ curl -X DELETE https://api.cronicorn.com/api/endpoints/ep_xyz789/hints \
|
|
|
294
294
|
Clear failure count (resets exponential backoff):
|
|
295
295
|
|
|
296
296
|
```bash
|
|
297
|
-
curl -X POST https://
|
|
297
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/reset-failures \
|
|
298
298
|
-H "x-api-key: YOUR_API_KEY"
|
|
299
299
|
```
|
|
300
300
|
|
|
@@ -333,7 +333,7 @@ The AI Planner can override exponential backoff by proposing a tighter interval
|
|
|
333
333
|
|
|
334
334
|
```bash
|
|
335
335
|
# Override backoff: monitor failing endpoint every 30 seconds
|
|
336
|
-
curl -X POST https://
|
|
336
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/hints/interval \
|
|
337
337
|
-H "x-api-key: YOUR_API_KEY" \
|
|
338
338
|
-H "Content-Type: application/json" \
|
|
339
339
|
-d '{
|
|
@@ -349,7 +349,7 @@ The AI interval hint overrides the baseline (including backoff). When the hint e
|
|
|
349
349
|
|
|
350
350
|
```javascript
|
|
351
351
|
// Create a job with status-code-aware scheduling
|
|
352
|
-
const response = await fetch('https://
|
|
352
|
+
const response = await fetch('https://cronicorn.com/api/jobs/job_abc123/endpoints', {
|
|
353
353
|
method: 'POST',
|
|
354
354
|
headers: {
|
|
355
355
|
'x-api-key': 'YOUR_API_KEY',
|
|
@@ -374,7 +374,7 @@ For more language examples (TypeScript, Python, MCP), see [Code Examples](./code
|
|
|
374
374
|
If exponential backoff has kicked in and you want to immediately return to baseline without waiting for a successful response:
|
|
375
375
|
|
|
376
376
|
```bash
|
|
377
|
-
curl -X POST https://
|
|
377
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/reset-failures \
|
|
378
378
|
-H "x-api-key: YOUR_API_KEY"
|
|
379
379
|
```
|
|
380
380
|
|
|
@@ -395,7 +395,7 @@ You can query run history to see status codes and response bodies:
|
|
|
395
395
|
|
|
396
396
|
```bash
|
|
397
397
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
398
|
-
"https://
|
|
398
|
+
"https://cronicorn.com/api/endpoints/ep_xyz789/runs?limit=10"
|
|
399
399
|
```
|
|
400
400
|
|
|
401
401
|
---
|
|
@@ -406,7 +406,7 @@ curl -H "x-api-key: YOUR_API_KEY" \
|
|
|
406
406
|
|
|
407
407
|
```bash
|
|
408
408
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
409
|
-
"https://
|
|
409
|
+
"https://cronicorn.com/api/endpoints/ep_xyz789/runs?limit=20&status=failed"
|
|
410
410
|
```
|
|
411
411
|
|
|
412
412
|
**Query Parameters:**
|
|
@@ -418,7 +418,7 @@ curl -H "x-api-key: YOUR_API_KEY" \
|
|
|
418
418
|
|
|
419
419
|
```bash
|
|
420
420
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
421
|
-
https://
|
|
421
|
+
https://cronicorn.com/api/runs/run_abc123
|
|
422
422
|
```
|
|
423
423
|
|
|
424
424
|
**Response:**
|
|
@@ -444,7 +444,7 @@ curl -H "x-api-key: YOUR_API_KEY" \
|
|
|
444
444
|
|
|
445
445
|
```bash
|
|
446
446
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
447
|
-
"https://
|
|
447
|
+
"https://cronicorn.com/api/endpoints/ep_xyz789/health?sinceHours=24"
|
|
448
448
|
```
|
|
449
449
|
|
|
450
450
|
**Response:**
|
|
@@ -465,7 +465,7 @@ curl -H "x-api-key: YOUR_API_KEY" \
|
|
|
465
465
|
|
|
466
466
|
```bash
|
|
467
467
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
468
|
-
"https://
|
|
468
|
+
"https://cronicorn.com/api/dashboard?startDate=2026-02-01&endDate=2026-02-03"
|
|
469
469
|
```
|
|
470
470
|
|
|
471
471
|
---
|
|
@@ -480,7 +480,7 @@ Get AI analysis history for an endpoint to understand why scheduling decisions w
|
|
|
480
480
|
|
|
481
481
|
```bash
|
|
482
482
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
483
|
-
"https://
|
|
483
|
+
"https://cronicorn.com/api/endpoints/ep_xyz789/analysis-sessions?limit=10"
|
|
484
484
|
```
|
|
485
485
|
|
|
486
486
|
**Query Parameters:**
|
|
@@ -512,7 +512,7 @@ curl -H "x-api-key: YOUR_API_KEY" \
|
|
|
512
512
|
|
|
513
513
|
```bash
|
|
514
514
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
515
|
-
https://
|
|
515
|
+
https://cronicorn.com/api/analysis-sessions/session_abc123
|
|
516
516
|
```
|
|
517
517
|
|
|
518
518
|
**Response:**
|
|
@@ -553,7 +553,7 @@ CPU_LOAD=$(curl -s https://your-monitoring.com/api/cpu-load | jq '.value')
|
|
|
553
553
|
|
|
554
554
|
if (( $(echo "$CPU_LOAD > 80" | bc -l) )); then
|
|
555
555
|
# High load detected: tighten monitoring to every 30 seconds
|
|
556
|
-
curl -X POST https://
|
|
556
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/hints/interval \
|
|
557
557
|
-H "x-api-key: YOUR_API_KEY" \
|
|
558
558
|
-H "Content-Type: application/json" \
|
|
559
559
|
-d '{
|
|
@@ -563,7 +563,7 @@ if (( $(echo "$CPU_LOAD > 80" | bc -l) )); then
|
|
|
563
563
|
}'
|
|
564
564
|
elif (( $(echo "$CPU_LOAD < 20" | bc -l) )); then
|
|
565
565
|
# Low load: relax monitoring to every 10 minutes
|
|
566
|
-
curl -X POST https://
|
|
566
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/hints/interval \
|
|
567
567
|
-H "x-api-key: YOUR_API_KEY" \
|
|
568
568
|
-H "Content-Type: application/json" \
|
|
569
569
|
-d '{
|
|
@@ -573,7 +573,7 @@ elif (( $(echo "$CPU_LOAD < 20" | bc -l) )); then
|
|
|
573
573
|
}'
|
|
574
574
|
else
|
|
575
575
|
# Normal load: clear any active hints to return to baseline
|
|
576
|
-
curl -X DELETE https://
|
|
576
|
+
curl -X DELETE https://cronicorn.com/api/endpoints/ep_xyz789/hints \
|
|
577
577
|
-H "x-api-key: YOUR_API_KEY"
|
|
578
578
|
fi
|
|
579
579
|
```
|
|
@@ -582,13 +582,13 @@ fi
|
|
|
582
582
|
|
|
583
583
|
```bash
|
|
584
584
|
# Pause all endpoints in a job during scheduled maintenance
|
|
585
|
-
curl -X POST https://
|
|
585
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/pause \
|
|
586
586
|
-H "x-api-key: YOUR_API_KEY"
|
|
587
587
|
|
|
588
588
|
# ... perform maintenance ...
|
|
589
589
|
|
|
590
590
|
# Resume after maintenance
|
|
591
|
-
curl -X POST https://
|
|
591
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/resume \
|
|
592
592
|
-H "x-api-key: YOUR_API_KEY"
|
|
593
593
|
```
|
|
594
594
|
|
|
@@ -77,7 +77,7 @@ Create a single job with TWO endpoints — placing them in the same job gives th
|
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
79
|
# Create the job (container for both endpoints)
|
|
80
|
-
curl -X POST https://
|
|
80
|
+
curl -X POST https://cronicorn.com/api/jobs \
|
|
81
81
|
-H "x-api-key: YOUR_API_KEY" \
|
|
82
82
|
-H "Content-Type: application/json" \
|
|
83
83
|
-d '{
|
|
@@ -87,7 +87,7 @@ curl -X POST https://api.cronicorn.com/api/jobs \
|
|
|
87
87
|
# Returns: { "id": "job_abc123", ... }
|
|
88
88
|
|
|
89
89
|
# Add the health-check endpoint
|
|
90
|
-
curl -X POST https://
|
|
90
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/endpoints \
|
|
91
91
|
-H "x-api-key: YOUR_API_KEY" \
|
|
92
92
|
-H "Content-Type: application/json" \
|
|
93
93
|
-d '{
|
|
@@ -102,7 +102,7 @@ curl -X POST https://api.cronicorn.com/api/jobs/job_abc123/endpoints \
|
|
|
102
102
|
# Returns: { "id": "ep_health123", ... }
|
|
103
103
|
|
|
104
104
|
# Add the recovery endpoint (same job = sibling of health-check)
|
|
105
|
-
curl -X POST https://
|
|
105
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/endpoints \
|
|
106
106
|
-H "x-api-key: YOUR_API_KEY" \
|
|
107
107
|
-H "Content-Type: application/json" \
|
|
108
108
|
-d '{
|
|
@@ -164,7 +164,7 @@ The same setup using `fetch()`:
|
|
|
164
164
|
|
|
165
165
|
```javascript
|
|
166
166
|
const API_KEY = 'YOUR_API_KEY';
|
|
167
|
-
const BASE_URL = 'https://
|
|
167
|
+
const BASE_URL = 'https://cronicorn.com';
|
|
168
168
|
|
|
169
169
|
// Create the job
|
|
170
170
|
const jobResponse = await fetch(`${BASE_URL}/api/jobs`, {
|
|
@@ -314,7 +314,7 @@ See what the AI decided and why:
|
|
|
314
314
|
|
|
315
315
|
```bash
|
|
316
316
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
317
|
-
"https://
|
|
317
|
+
"https://cronicorn.com/api/endpoints/ENDPOINT_ID/analysis-sessions?limit=5"
|
|
318
318
|
```
|
|
319
319
|
|
|
320
320
|
Look for:
|
|
@@ -327,7 +327,7 @@ Look for:
|
|
|
327
327
|
Force an immediate recovery attempt:
|
|
328
328
|
|
|
329
329
|
```bash
|
|
330
|
-
curl -X POST https://
|
|
330
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_recovery456/hints/oneshot \
|
|
331
331
|
-H "x-api-key: YOUR_API_KEY" \
|
|
332
332
|
-H "Content-Type: application/json" \
|
|
333
333
|
-d '{
|
|
@@ -342,7 +342,7 @@ curl -X POST https://api.cronicorn.com/api/endpoints/ep_recovery456/hints/onesho
|
|
|
342
342
|
If exponential backoff has kicked in:
|
|
343
343
|
|
|
344
344
|
```bash
|
|
345
|
-
curl -X POST https://
|
|
345
|
+
curl -X POST https://cronicorn.com/api/endpoints/ENDPOINT_ID/reset-failures \
|
|
346
346
|
-H "x-api-key: YOUR_API_KEY"
|
|
347
347
|
```
|
|
348
348
|
|
|
@@ -352,7 +352,7 @@ View success/failure rates over the last 24 hours:
|
|
|
352
352
|
|
|
353
353
|
```bash
|
|
354
354
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
355
|
-
"https://
|
|
355
|
+
"https://cronicorn.com/api/endpoints/ENDPOINT_ID/health?sinceHours=24"
|
|
356
356
|
```
|
|
357
357
|
|
|
358
358
|
Response:
|
|
@@ -29,7 +29,7 @@ All examples use the Cronicorn HTTP API. Authenticate with an API key (`x-api-ke
|
|
|
29
29
|
|
|
30
30
|
```javascript
|
|
31
31
|
const API_KEY = 'YOUR_API_KEY';
|
|
32
|
-
const BASE_URL = 'https://
|
|
32
|
+
const BASE_URL = 'https://cronicorn.com';
|
|
33
33
|
|
|
34
34
|
async function createHealthMonitoringJob() {
|
|
35
35
|
// Step 1: Create the job
|
|
@@ -193,7 +193,7 @@ async function getAIDecisions(endpointId, limit = 5) {
|
|
|
193
193
|
import requests
|
|
194
194
|
|
|
195
195
|
API_KEY = "YOUR_API_KEY"
|
|
196
|
-
BASE_URL = "https://
|
|
196
|
+
BASE_URL = "https://cronicorn.com"
|
|
197
197
|
HEADERS = {
|
|
198
198
|
"x-api-key": API_KEY,
|
|
199
199
|
"Content-Type": "application/json"
|
|
@@ -243,7 +243,7 @@ print("Cronicorn is now polling every 5 minutes with AI adaptation enabled.")
|
|
|
243
243
|
import requests
|
|
244
244
|
|
|
245
245
|
API_KEY = "YOUR_API_KEY"
|
|
246
|
-
BASE_URL = "https://
|
|
246
|
+
BASE_URL = "https://cronicorn.com"
|
|
247
247
|
ENDPOINT_ID = "ep_xyz789"
|
|
248
248
|
HEADERS = {"x-api-key": API_KEY, "Content-Type": "application/json"}
|
|
249
249
|
|
|
@@ -391,7 +391,7 @@ A complete example showing how to configure an endpoint that polls **less freque
|
|
|
391
391
|
|
|
392
392
|
```javascript
|
|
393
393
|
const API_KEY = 'YOUR_API_KEY';
|
|
394
|
-
const BASE_URL = 'https://
|
|
394
|
+
const BASE_URL = 'https://cronicorn.com';
|
|
395
395
|
const headers = { 'x-api-key': API_KEY, 'Content-Type': 'application/json' };
|
|
396
396
|
|
|
397
397
|
async function createInverseScalingJob() {
|
|
@@ -93,7 +93,7 @@ This is the canonical configuration format. All fields shown in examples through
|
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
95
|
# Step 1: Create a job
|
|
96
|
-
curl -X POST https://
|
|
96
|
+
curl -X POST https://cronicorn.com/api/jobs \
|
|
97
97
|
-H "x-api-key: YOUR_API_KEY" \
|
|
98
98
|
-H "Content-Type: application/json" \
|
|
99
99
|
-d '{
|
|
@@ -103,7 +103,7 @@ curl -X POST https://api.cronicorn.com/api/jobs \
|
|
|
103
103
|
# Returns: { "id": "job_abc123", "name": "Production API Monitoring", ... }
|
|
104
104
|
|
|
105
105
|
# Step 2: Add an endpoint to the job
|
|
106
|
-
curl -X POST https://
|
|
106
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/endpoints \
|
|
107
107
|
-H "x-api-key: YOUR_API_KEY" \
|
|
108
108
|
-H "Content-Type: application/json" \
|
|
109
109
|
-d '{
|
|
@@ -122,11 +122,11 @@ curl -X POST https://api.cronicorn.com/api/jobs/job_abc123/endpoints \
|
|
|
122
122
|
|
|
123
123
|
# Step 3: Check endpoint health and run history
|
|
124
124
|
curl -H "x-api-key: YOUR_API_KEY" \
|
|
125
|
-
"https://
|
|
125
|
+
"https://cronicorn.com/api/endpoints/ep_xyz789/runs?limit=5"
|
|
126
126
|
# Returns recent runs with status, duration, and response bodies
|
|
127
127
|
|
|
128
128
|
# Step 4: Manually override scheduling during an incident
|
|
129
|
-
curl -X POST https://
|
|
129
|
+
curl -X POST https://cronicorn.com/api/endpoints/ep_xyz789/hints/interval \
|
|
130
130
|
-H "x-api-key: YOUR_API_KEY" \
|
|
131
131
|
-H "Content-Type: application/json" \
|
|
132
132
|
-d '{
|
|
@@ -143,7 +143,7 @@ curl -X POST https://api.cronicorn.com/api/endpoints/ep_xyz789/hints/interval \
|
|
|
143
143
|
#!/bin/bash
|
|
144
144
|
# create-monitoring-job.sh — Creates a health monitoring job in Cronicorn
|
|
145
145
|
API_KEY="YOUR_API_KEY"
|
|
146
|
-
BASE_URL="https://
|
|
146
|
+
BASE_URL="https://cronicorn.com"
|
|
147
147
|
|
|
148
148
|
# Create the job
|
|
149
149
|
JOB_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/api/jobs" \
|
|
@@ -556,7 +556,7 @@ The most common Cronicorn pattern: a job maintains a **baseline schedule** but *
|
|
|
556
556
|
|
|
557
557
|
```bash
|
|
558
558
|
# Create a job that tightens during surges and returns to baseline when conditions normalize
|
|
559
|
-
curl -X POST https://
|
|
559
|
+
curl -X POST https://cronicorn.com/api/jobs/job_abc123/endpoints \
|
|
560
560
|
-H "x-api-key: YOUR_API_KEY" \
|
|
561
561
|
-H "Content-Type: application/json" \
|
|
562
562
|
-d '{
|