-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.html
754 lines (721 loc) · 40.3 KB
/
api.html
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
<!doctype html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7 documentation"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8 documentation"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9 documentation"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en" class="documentation"> <!--<![endif]-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>API Reference — Vulcand documentation 2.0 documentation</title>
<link rel="stylesheet" href="_static/main.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '2.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Vulcand documentation 2.0 documentation" href="index.html" />
<link rel="prev" title="Middlewares" href="middlewares.html" />
<link media="only screen and (max-device-width: 480px)" href="_static/mobile.css" type="text/css" rel="stylesheet" />
<link rel="icon" type="image/png" href="_static/img/favicon.png" />
<!-- <link rel="stylesheet" href="_static/docs.css" /> -->
<link rel="stylesheet" href="http://www.mailgun.com/static/css/main.css" />
<meta name="viewport" content="width=device-width">
</head>
<body role="document">
<header style="content:none">
<div class="container">
<a href="http://github.com/mailgun/vulcand/" style="float:left;margin-top:20px;margin-bottom:20px;background:url(_static/img/vulcan.png) no-repeat">
<img src="_static/img/vulcan.png">
</img>
</a>
<nav class="header-nav" id="js-header-nav">
<a href="//www.vulcanproxy.com" class="active"><b>Documentation</b></a>
</nav>
<button id="js-show-nav"><i class="icon-reorder"></i></button>
</div>
</header>
<div id="body">
<section class="subnav">
<div class="container">
<a target="blank" href="https://github.com/mailgun/vulcand-docs" class="edit-docs-link" onclick="mixpanel.track('Clicked Edit Docs Link');">Edit</a>
<ul id="headerButtons" class="nav nav-pills">
<li class="lang-label">
Samples:
</li>
<li class="lang">
<a href="" id="lang_etcd">Etcd</a>
</li>
<li class="lang">
<a href="" id="lang_cli">Vulcanctl</a>
</li>
<li class="lang">
<a href="" id="lang_api">API</a>
</li>
</ul>
</div>
</section>
<section class="main">
<div class="container">
<aside id="sphinxsidebar" class="docs-sidebar">
<div class="sphinxsidebarwrapper">
<ul><li class="toctree-l1"><a href="index.html">Main Page</a></li></ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick Start</a></li>
<li class="toctree-l1"><a class="reference internal" href="proxy.html">User Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="middlewares.html">Middlewares</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#status">Status</a></li>
<li class="toctree-l2"><a class="reference internal" href="#log-severity">Log severity</a></li>
<li class="toctree-l2"><a class="reference internal" href="#host">Host</a></li>
<li class="toctree-l2"><a class="reference internal" href="#listener">Listener</a></li>
<li class="toctree-l2"><a class="reference internal" href="#backend">Backend</a></li>
<li class="toctree-l2"><a class="reference internal" href="#server">Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="#frontend">Frontend</a></li>
<li class="toctree-l2"><a class="reference internal" href="#rate-limit">Rate limit</a></li>
<li class="toctree-l2"><a class="reference internal" href="#connection-limit">Connection limit</a></li>
</ul>
</li>
</ul>
</div>
</aside>
<div class="document">
<div id="st-results-container"></div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="api-reference">
<span id="api"></span><h1>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this headline">¶</a></h1>
<p>Vulcan’s HTTP API is the best way to configure one or several instances of Vulcan at the same time.
Essentially it’s a tiny wrapper around the backend. Multiple Vulcand instances listening to the same prefix would detect changes simultaneously and reload configuration.</p>
<div class="section" id="status">
<h2>Status<a class="headerlink" href="#status" title="Permalink to this headline">¶</a></h2>
<p>Status endpoint is handy when you need to integrate Vulcand with another load balancer that can poll Vulcand to route the traffic based on the healthcheck response.</p>
<div class="section" id="check-status">
<h3>Check status<a class="headerlink" href="#check-status" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/status
</pre></div>
</div>
<p>Returns: <code class="docutils literal"><span class="pre">200</span> <span class="pre">OK</span></code></p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Status"</span><span class="p">:</span> <span class="s2">"ok"</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="log-severity">
<h2>Log severity<a class="headerlink" href="#log-severity" title="Permalink to this headline">¶</a></h2>
<p>Log severity endpoint allows to change the logging severity for a running instance</p>
<div class="section" id="get-severity">
<h3>Get severity<a class="headerlink" href="#get-severity" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/log/severity
</pre></div>
</div>
<p>Returns: <code class="docutils literal"><span class="pre">200</span> <span class="pre">OK</span></code></p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Severity"</span><span class="p">:</span> <span class="s2">"WARN"</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="set-severity">
<h3>Set severity<a class="headerlink" href="#set-severity" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>PUT 'multipart/form-data' /v1/log/severity
</pre></div>
</div>
<div class="ptable container">
<table border="1" class="docutils">
<colgroup>
<col width="23%" />
<col width="77%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>severity</td>
<td>Severity - <code class="docutils literal"><span class="pre">WARN</span></code>, <code class="docutils literal"><span class="pre">INFO</span></code> or <code class="docutils literal"><span class="pre">ERROR</span></code></td>
</tr>
</tbody>
</table>
</div>
<p>Returns: <code class="docutils literal"><span class="pre">200</span> <span class="pre">OK</span></code></p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Message"</span><span class="p">:</span> <span class="s2">"Severity has been updated to INFO"</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="host">
<h2>Host<a class="headerlink" href="#host" title="Permalink to this headline">¶</a></h2>
<div class="section" id="get-hosts">
<h3>Get hosts<a class="headerlink" href="#get-hosts" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/hosts
</pre></div>
</div>
<p>Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Hosts"</span><span class="p">:[</span>
<span class="p">{</span>
<span class="nt">"Name"</span><span class="p">:</span><span class="s2">"localhost"</span><span class="p">,</span>
<span class="nt">"Settings"</span><span class="p">:{</span>
<span class="nt">"KeyPair"</span><span class="p">:</span><span class="kc">null</span><span class="p">,</span>
<span class="nt">"Default"</span><span class="p">:</span><span class="kc">false</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="upsert-host">
<h3>Upsert host<a class="headerlink" href="#upsert-host" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>POST 'application/json' /v2/hosts
</pre></div>
</div>
<p>Add a host to the proxy.</p>
<div class="highlight-json"><div class="highlight"><pre>{
"Host": {
"Name": "localhost", // hostname
"Settings": { // settings are optional
"KeyPair": {"Cert": "base64", Key: "base64"}, // base64 encoded key-pair certficate
"Default": false , // default host for SNI
}
}
</pre></div>
</div>
<p>}</p>
<p>Example responses:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Name"</span><span class="p">:</span> <span class="s2">"localhost"</span><span class="p">,</span>
<span class="nt">"Settings"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"KeyPair"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">"Default"</span><span class="p">:</span> <span class="kc">false</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="delete-host">
<h3>Delete host<a class="headerlink" href="#delete-host" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>DELETE /v2/hosts/<name>
</pre></div>
</div>
<p>Delete a host.</p>
</div>
</div>
<div class="section" id="listener">
<h2>Listener<a class="headerlink" href="#listener" title="Permalink to this headline">¶</a></h2>
<div class="section" id="upsert-listener">
<h3>Upsert listener<a class="headerlink" href="#upsert-listener" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>POST 'application/json' /v2/listeners
</pre></div>
</div>
<p>Upsert listener</p>
<div class="highlight-json"><div class="highlight"><pre>{
"Listener": {
"Id": "l1",
"Protocol": "https", // http or https
"Address":
{
"Network":"tcp", // unix or tcp
"Address":"localhost:8184"
}
}
}
</pre></div>
</div>
<p>Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"12"</span><span class="p">,</span>
<span class="nt">"Protocol"</span><span class="p">:</span> <span class="s2">"https"</span><span class="p">,</span>
<span class="nt">"Address"</span><span class="p">:</span>
<span class="p">{</span>
<span class="nt">"Network"</span><span class="p">:</span><span class="s2">"tcp"</span><span class="p">,</span>
<span class="nt">"Address"</span><span class="p">:</span><span class="s2">"localhost:8184"</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="delete-listener">
<h3>Delete listener<a class="headerlink" href="#delete-listener" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>DELETE /v2/listeners/<listener-id>
</pre></div>
</div>
<p>Delete a listener</p>
</div>
</div>
<div class="section" id="backend">
<h2>Backend<a class="headerlink" href="#backend" title="Permalink to this headline">¶</a></h2>
<div class="section" id="get-backends">
<h3>Get backends<a class="headerlink" href="#get-backends" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/backends
</pre></div>
</div>
<p>Retrieve the existing upstreams. Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Backends"</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"b1"</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"http"</span><span class="p">,</span>
<span class="nt">"Settings"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Timeouts"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Read"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"Dial"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"TLSHandshake"</span><span class="p">:</span> <span class="s2">""</span>
<span class="p">},</span>
<span class="nt">"KeepAlive"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Period"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"MaxIdleConnsPerHost"</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="upsert-backend">
<h3>Upsert backend<a class="headerlink" href="#upsert-backend" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>POST 'application/json' /v2/backends
</pre></div>
</div>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Backend"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"b1"</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"http"</span><span class="p">,</span>
<span class="nt">"Settings"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Timeouts"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Read"</span><span class="p">:</span> <span class="s2">"5s"</span><span class="p">,</span>
<span class="nt">"Dial"</span><span class="p">:</span> <span class="s2">"5s"</span><span class="p">,</span>
<span class="nt">"TLSHandshake"</span><span class="p">:</span> <span class="s2">"10s"</span>
<span class="p">},</span>
<span class="nt">"KeepAlive"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Period"</span><span class="p">:</span> <span class="s2">"30s"</span><span class="p">,</span>
<span class="nt">"MaxIdleConnsPerHost"</span><span class="p">:</span> <span class="mi">12</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"b1"</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"http"</span><span class="p">,</span>
<span class="nt">"Settings"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Timeouts"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Read"</span><span class="p">:</span> <span class="s2">"5s"</span><span class="p">,</span>
<span class="nt">"Dial"</span><span class="p">:</span> <span class="s2">"5s"</span><span class="p">,</span>
<span class="nt">"TLSHandshake"</span><span class="p">:</span> <span class="s2">"10s"</span>
<span class="p">},</span>
<span class="nt">"KeepAlive"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Period"</span><span class="p">:</span> <span class="s2">"30s"</span><span class="p">,</span>
<span class="nt">"MaxIdleConnsPerHost"</span><span class="p">:</span> <span class="mi">12</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="delete-backend">
<h3>Delete backend<a class="headerlink" href="#delete-backend" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>DELETE /v2/backends/<id>
</pre></div>
</div>
</div>
</div>
<div class="section" id="server">
<h2>Server<a class="headerlink" href="#server" title="Permalink to this headline">¶</a></h2>
<div class="section" id="get-servers">
<h3>Get servers<a class="headerlink" href="#get-servers" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/backends/<id>/servers
</pre></div>
</div>
<p>Retrieve the servers of the backend. Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Servers"</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"srv1"</span><span class="p">,</span>
<span class="nt">"URL"</span><span class="p">:</span> <span class="s2">"http://localhost:5000"</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"srv2"</span><span class="p">,</span>
<span class="nt">"URL"</span><span class="p">:</span> <span class="s2">"http://localhost:5003"</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="get-server">
<h3>Get server<a class="headerlink" href="#get-server" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/backends/<id>/servers/<server-id>
</pre></div>
</div>
<p>Retrieve the particular server with id <code class="docutils literal"><span class="pre">server-id</span></code></p>
</div>
<div class="section" id="upsert-endpoint">
<h3>Upsert endpoint<a class="headerlink" href="#upsert-endpoint" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>POST /v1/upstreams/<id>/endpoints
</pre></div>
</div>
<p>Upsert server to the backend</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Server"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"srv1"</span><span class="p">,</span>
<span class="nt">"URL"</span><span class="p">:</span> <span class="s2">"http://localhost:5000"</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"e4"</span><span class="p">,</span>
<span class="nt">"Url"</span><span class="p">:</span> <span class="s2">"http://localhost:5004"</span><span class="p">,</span>
<span class="nt">"Stats"</span><span class="p">:</span> <span class="kc">null</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="delete-server">
<h3>Delete server<a class="headerlink" href="#delete-server" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>DELETE /v2/backends/<id>/servers/<server-id>
</pre></div>
</div>
<p>Delete a server.</p>
</div>
</div>
<div class="section" id="frontend">
<h2>Frontend<a class="headerlink" href="#frontend" title="Permalink to this headline">¶</a></h2>
<div class="section" id="get-frontends">
<h3>Get frontends<a class="headerlink" href="#get-frontends" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/frontends
</pre></div>
</div>
<p>Retrieve the frontends. Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Frontends"</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"f1"</span><span class="p">,</span>
<span class="nt">"Route"</span><span class="p">:</span> <span class="s2">"Path(`/`)"</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"http"</span><span class="p">,</span>
<span class="nt">"BackendId"</span><span class="p">:</span> <span class="s2">"b1"</span><span class="p">,</span>
<span class="nt">"Settings"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Limits"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"MaxMemBodyBytes"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">"MaxBodyBytes"</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">},</span>
<span class="nt">"FailoverPredicate"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"Hostname"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"TrustForwardHeader"</span><span class="p">:</span> <span class="kc">false</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="get-frontend">
<h3>Get frontend<a class="headerlink" href="#get-frontend" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/frontends/<frontend-id>
</pre></div>
</div>
<p>Retrieve the particular frontend with id <code class="docutils literal"><span class="pre">frontend-id</span></code></p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"f1"</span><span class="p">,</span>
<span class="nt">"Route"</span><span class="p">:</span> <span class="s2">"Path(`/`)"</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"http"</span><span class="p">,</span>
<span class="nt">"BackendId"</span><span class="p">:</span> <span class="s2">"b1"</span><span class="p">,</span>
<span class="nt">"Settings"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Limits"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"MaxMemBodyBytes"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">"MaxBodyBytes"</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">},</span>
<span class="nt">"FailoverPredicate"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"Hostname"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"TrustForwardHeader"</span><span class="p">:</span> <span class="kc">false</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="upsert-frontend">
<h3>Upsert frontend<a class="headerlink" href="#upsert-frontend" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>POST 'application/json' /v1/hosts/<hostname>/frontends
</pre></div>
</div>
<p>Add a frontend to the host. Params:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Frontend"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"f1"</span><span class="p">,</span>
<span class="nt">"Route"</span><span class="p">:</span> <span class="s2">"Path(`\/`)"</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"http"</span><span class="p">,</span>
<span class="nt">"BackendId"</span><span class="p">:</span> <span class="s2">"b1"</span><span class="p">,</span>
<span class="nt">"Settings"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Limits"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"MaxMemBodyBytes"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">"MaxBodyBytes"</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">},</span>
<span class="nt">"FailoverPredicate"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"Hostname"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"TrustForwardHeader"</span><span class="p">:</span> <span class="kc">false</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"f1"</span><span class="p">,</span>
<span class="nt">"Route"</span><span class="p">:</span> <span class="s2">"Path(`/`)"</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"http"</span><span class="p">,</span>
<span class="nt">"BackendId"</span><span class="p">:</span> <span class="s2">"b1"</span><span class="p">,</span>
<span class="nt">"Settings"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Limits"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"MaxMemBodyBytes"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">"MaxBodyBytes"</span><span class="p">:</span> <span class="mi">0</span>
<span class="p">},</span>
<span class="nt">"FailoverPredicate"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"Hostname"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="nt">"TrustForwardHeader"</span><span class="p">:</span> <span class="kc">false</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="delete-frontend">
<h3>Delete frontend<a class="headerlink" href="#delete-frontend" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>DELETE /v2/frontends/<frontend-id>
</pre></div>
</div>
<p>Delete a frontend.</p>
</div>
</div>
<div class="section" id="rate-limit">
<h2>Rate limit<a class="headerlink" href="#rate-limit" title="Permalink to this headline">¶</a></h2>
<div class="section" id="get-rate-limit">
<h3>Get rate limit<a class="headerlink" href="#get-rate-limit" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/frontends/<frontend-id>/middlewares/<middleware-id>
</pre></div>
</div>
<p>Retrieve the particular rate of frontend with id <code class="docutils literal"><span class="pre">frontend-id</span></code> and rate id <code class="docutils literal"><span class="pre">rate-id</span></code>
Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"rl1"</span><span class="p">,</span>
<span class="nt">"Priority"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"ratelimit"</span><span class="p">,</span>
<span class="nt">"Middleware"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"PeriodSeconds"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="nt">"Burst"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
<span class="nt">"Variable"</span><span class="p">:</span> <span class="s2">"client.ip"</span><span class="p">,</span>
<span class="nt">"Requests"</span><span class="p">:</span> <span class="mi">1</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="upsert-rate-limit">
<h3>Upsert rate limit<a class="headerlink" href="#upsert-rate-limit" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>POST 'application/json' /v2/frontends/middlewares
</pre></div>
</div>
<p>Add a rate limit to the frontend, will take effect immediately.</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Middleware"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"rl1"</span><span class="p">,</span>
<span class="nt">"Priority"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"ratelimit"</span><span class="p">,</span>
<span class="nt">"Middleware"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"PeriodSeconds"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="nt">"Burst"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
<span class="nt">"Variable"</span><span class="p">:</span> <span class="s2">"client.ip"</span><span class="p">,</span>
<span class="nt">"Requests"</span><span class="p">:</span> <span class="mi">1</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Json parameters explained:</p>
<div class="ptable container">
<table border="1" class="docutils">
<colgroup>
<col width="18%" />
<col width="82%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>Id</td>
<td>Optional rate id, will be generated if omitted</td>
</tr>
<tr class="row-odd"><td>Requests</td>
<td>Required amount of allowed requests</td>
</tr>
<tr class="row-even"><td>PeriodSeconds</td>
<td>Required period in seconds for counting the requests</td>
</tr>
<tr class="row-odd"><td>Burst</td>
<td>Required allowed burst of the requests (additional requests exceeding the rate)</td>
</tr>
<tr class="row-even"><td>Variable</td>
<td>Variable for rate limiting e.g. <cite>client.ip</cite> or <cite>request.header.My-Header</cite></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="delete-a-rate-limit">
<h3>Delete a rate limit<a class="headerlink" href="#delete-a-rate-limit" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>DELETE /v2/frontends/<frontend-id>/middlewares/<middleware-id>
</pre></div>
</div>
<p>Deletes rate limit from the frontend.</p>
</div>
</div>
<div class="section" id="connection-limit">
<h2>Connection limit<a class="headerlink" href="#connection-limit" title="Permalink to this headline">¶</a></h2>
<div class="section" id="get-connection-limit">
<h3>Get connection limit<a class="headerlink" href="#get-connection-limit" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>GET /v2/frontends/<frontend-id>/middlewares/<conn-id>
</pre></div>
</div>
<p>Retrieve the particular connection limit of frontend with id <code class="docutils literal"><span class="pre">frontend-id</span></code> and connection limit id <code class="docutils literal"><span class="pre">conn-id</span></code>. Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"cl1"</span><span class="p">,</span>
<span class="nt">"Priority"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"connlimit"</span><span class="p">,</span>
<span class="nt">"Middleware"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Connections"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
<span class="nt">"Variable"</span><span class="p">:</span> <span class="s2">"client.ip"</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="upsert-connection-limit">
<h3>Upsert connection limit<a class="headerlink" href="#upsert-connection-limit" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>POST 'application/json' /v2/frontends/<frontend>/middlewares
</pre></div>
</div>
<p>Upsert a connection limit to the frontend. Example response:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">"Middleware"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"cl1"</span><span class="p">,</span>
<span class="nt">"Priority"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">"Type"</span><span class="p">:</span> <span class="s2">"connlimit"</span><span class="p">,</span>
<span class="nt">"Middleware"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"Connections"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
<span class="nt">"Variable"</span><span class="p">:</span> <span class="s2">"client.ip"</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>JSON parameters explained</p>
<div class="ptable container">
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="81%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>Id</td>
<td>Optional limit id, will be generated if omitted.|</td>
</tr>
<tr class="row-odd"><td>Connections</td>
<td>Required maximum amount of allowed simultaneous connections|</td>
</tr>
<tr class="row-even"><td>Variable</td>
<td>Variable for limiting e.g. <code class="docutils literal"><span class="pre">client.ip</span></code> or <code class="docutils literal"><span class="pre">request.header.My-Header</span></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="delete-connection-limit">
<h3>Delete connection limit<a class="headerlink" href="#delete-connection-limit" title="Permalink to this headline">¶</a></h3>
<div class="highlight-url"><div class="highlight"><pre>DELETE /v2/frontends/<frontend-id>/middlewares/<conn-id>
</pre></div>
</div>
<p>Delete a connection limit from the frontend.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p><a href="https://github.com/mailgun/vulcand">Found a typo? Send a pull request!</a></p>
<P>Docs created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.</P>
</div>
<div class="clearer"></div>
</div>
</div> <!-- /content -->
</section> <!-- /container -->
</div> <!-- /body -->
<footer>
<div class="container">
<nav class="footer-nav">
<a href="http://twitter.com/mail_gun">Mailgun Twitter</a>
<a href="http://vulcan.ghost.io">Blog</a>
</nav>
</div>
</footer>
<script type="text/javascript" charset="utf-8" src="_static/toc.js"></script>
<script type="text/javascript" charset="utf-8" src="_static/jquery.debounce.min.js"></script>
<script type="text/javascript" charset="utf-8" src="_static/jquery.cookie.min.js"></script>
<script type="text/javascript" charset="utf-8" src="_static/jquery.viewport.min.js"></script>
<script type="text/javascript" charset="utf-8" src="_static/samples.js"></script>
<script type="text/javascript" charset="utf-8" src="_static/scroll_hash.js"></script>
<script type="text/javascript" charset="utf-8" src="_static/underscore-min.js"></script>
<script type="text/javascript">
window.underscore = _.noConflict();
</script>
<script type="text/javascript">
$('input[type=\"search\"]').wrap('<span style=\"position:relative;\"></span>').after('<i id="clear-search" class="icon-remove-sign" style=\"position:absolute; right:5px;line-height:26px;\"></i><i class="icon-search" style=\"position:absolute; left:5px;line-height:26px;\"></i>');
$('#clear-search').click(function(){
$(this).parent().find('input').val('');
$(this).parent().find('input').focus();
});
// $("input").focusout(function() {this.value = "";});
// Responsive navigation show/hide main nav
$("#js-show-nav").click(function(){
$("#js-header-nav").slideToggle();
});
// highlight nav on load
$(document).ready(function(){
$('.docs-sidebar li').removeClass('active');
$('.docs-sidebar ul.current li.current a.current').parent().addClass('active');
});
</script>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55222876-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>