blob: 85df23165acb9daf9cc8040e967603100c1c3cde [file] [log] [blame]
Lusheng Jib2a561b2018-03-27 23:24:33 -04001Config Binding Service 2.1.0
2============================
3
4.. toctree::
5 :maxdepth: 3
6
7
8
9
10
11DEFAULT
12~~~~~~~
13
14
15
16
17GET ``/service_component_all/{service_component_name}``
18-------------------------------------------------------
19
20
21
22Description
23+++++++++++
24
25.. raw:: html
26
27 Binds the configuration for service_component_name and returns the bound configuration, policies, and any other keys that are in Consul
28
29Parameters
30++++++++++
31
32.. csv-table::
33 :delim: |
34 :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
35 :widths: 20, 15, 10, 10, 10, 20, 30
36
37 service_component_name | path | Yes | string | | | Service Component Name. service_component_name must be a key in consul.
38
39
40Request
41+++++++
42
43
44Responses
45+++++++++
46
47**200**
48^^^^^^^
49
50OK; returns {config : ..., policies : ....., k : ...} for all other k in Consul
51
52
53.. _i_4d863967ef9a9d9efdadd1b250c76bd6:
54
55**Response Schema:**
56
57
58
59
60**Example:**
61
62.. code-block:: javascript
63
64 {}
65
66**404**
67^^^^^^^
68
69there is no configuration in Consul for this component
70
71
72
73
74
75
76GET ``/service_component/{service_component_name}``
77---------------------------------------------------
78
79
80
81Description
82+++++++++++
83
84.. raw:: html
85
86 Binds the configuration for service_component_name and returns the bound configuration as a JSON
87
88Parameters
89++++++++++
90
91.. csv-table::
92 :delim: |
93 :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
94 :widths: 20, 15, 10, 10, 10, 20, 30
95
96 service_component_name | path | Yes | string | | | Service Component Name. service_component_name must be a key in consul.
97
98
99Request
100+++++++
101
102
103Responses
104+++++++++
105
106**200**
107^^^^^^^
108
109OK; the bound config is returned as an object
110
111
Lusheng Jib2a561b2018-03-27 23:24:33 -0400112**Response Schema:**
113
114
115
116
117**Example:**
118
119.. code-block:: javascript
120
121 {}
122
123**404**
124^^^^^^^
125
126there is no configuration in Consul for this component
127
128
129
130
131
132
133GET ``/{key}/{service_component_name}``
134---------------------------------------
135
136
137
138Description
139+++++++++++
140
141.. raw:: html
142
143 this is an endpoint that fetches a generic service_component_name:key out of Consul. The idea is that we don't want to tie components to Consul directly in case we swap out the backend some day, so the CBS abstracts Consul from clients. The structuring and weird collision of this new API with the above is unfortunate but due to legacy concerns.
144
145Parameters
146++++++++++
147
148.. csv-table::
149 :delim: |
150 :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
151 :widths: 20, 15, 10, 10, 10, 20, 30
152
153 key | path | Yes | string | | | this endpoint tries to pull service_component_name:key; key is the key after the colon
154 service_component_name | path | Yes | string | | | Service Component Name.
155
156
157Request
158+++++++
159
160
161Responses
162+++++++++
163
164**200**
165^^^^^^^
166
167OK; returns service_component_name:key
168
169
Lusheng Jib2a561b2018-03-27 23:24:33 -0400170
171**Response Schema:**
172
173
174
175
176**Example:**
177
178.. code-block:: javascript
179
180 {}
181
182**400**
183^^^^^^^
184
185bad request. Currently this is only returned on :policies, which is a complex object, and should be gotten through service_component_all
186
187
188**404**
189^^^^^^^
190
191key does not exist
192
193
194
195
196
197
198GET ``/healthcheck``
199--------------------
200
201
202
203Description
204+++++++++++
205
206.. raw:: html
207
208 This is the health check endpoint. If this returns a 200, the server is alive and consul can be reached. If not a 200, either dead, or no connection to consul
209
210
211Request
212+++++++
213
214
215Responses
216+++++++++
217
218**200**
219^^^^^^^
220
221Successful response
222
223
224**503**
225^^^^^^^
226
227the config binding service cannot reach Consul
228
229
230
231
232
233Data Structures
234~~~~~~~~~~~~~~~
235