Add documentation
[dcaegen2.git] / docs / sections / apis / configbinding.rst
1 Config Binding Service 2.1.0
2 ============================
3
4 .. toctree::
5     :maxdepth: 3
6
7
8
9
10
11 DEFAULT
12 ~~~~~~~
13
14
15
16
17 GET ``/service_component_all/{service_component_name}``
18 -------------------------------------------------------
19
20
21
22 Description
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
29 Parameters
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
40 Request
41 +++++++
42
43
44 Responses
45 +++++++++
46
47 **200**
48 ^^^^^^^
49
50 OK; 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
69 there is no configuration in Consul for this component
70
71
72
73
74
75
76 GET ``/service_component/{service_component_name}``
77 ---------------------------------------------------
78
79
80
81 Description
82 +++++++++++
83
84 .. raw:: html
85
86     Binds the configuration for service_component_name and returns the bound configuration as a JSON
87
88 Parameters
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
99 Request
100 +++++++
101
102
103 Responses
104 +++++++++
105
106 **200**
107 ^^^^^^^
108
109 OK; the bound config is returned as an object
110
111
112 .. _i_4d863967ef9a9d9efdadd1b250c76bd6:
113
114 **Response Schema:**
115
116
117
118
119 **Example:**
120
121 .. code-block:: javascript
122
123     {}
124
125 **404**
126 ^^^^^^^
127
128 there is no configuration in Consul for this component
129
130
131
132
133
134
135 GET ``/{key}/{service_component_name}``
136 ---------------------------------------
137
138
139
140 Description
141 +++++++++++
142
143 .. raw:: html
144
145     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.
146
147 Parameters
148 ++++++++++
149
150 .. csv-table::
151     :delim: |
152     :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
153     :widths: 20, 15, 10, 10, 10, 20, 30
154
155         key | path | Yes | string |  |  | this endpoint tries to pull service_component_name:key; key is the key after the colon
156         service_component_name | path | Yes | string |  |  | Service Component Name.
157
158
159 Request
160 +++++++
161
162
163 Responses
164 +++++++++
165
166 **200**
167 ^^^^^^^
168
169 OK; returns service_component_name:key
170
171
172 .. _i_4d863967ef9a9d9efdadd1b250c76bd6:
173
174 **Response Schema:**
175
176
177
178
179 **Example:**
180
181 .. code-block:: javascript
182
183     {}
184
185 **400**
186 ^^^^^^^
187
188 bad request. Currently this is only returned on :policies, which is a complex object, and should be gotten through service_component_all
189
190
191 **404**
192 ^^^^^^^
193
194 key does not exist
195
196
197
198
199
200
201 GET ``/healthcheck``
202 --------------------
203
204
205
206 Description
207 +++++++++++
208
209 .. raw:: html
210
211     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
212
213
214 Request
215 +++++++
216
217
218 Responses
219 +++++++++
220
221 **200**
222 ^^^^^^^
223
224 Successful response
225
226
227 **503**
228 ^^^^^^^
229
230 the config binding service cannot reach Consul
231
232
233
234
235   
236 Data Structures
237 ~~~~~~~~~~~~~~~
238