summaryrefslogtreecommitdiffstats
path: root/docs/sections/apis/configbinding.rst
blob: 0b947dbf4dbf3a883e643dda5f46022a4192a9e4 (plain)
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
Config Binding Service 2.2.3
============================

.. toctree::
    :maxdepth: 3

.. csv-table::
   :header: "API name", "Swagger JSON", "Swagger YAML"
   :widths: 10,5,5

   "Config Binding Service", ":download:`link <configbinding.json>`", ":download:`link <configbinding.yaml>`"

GET ``/service_component_all/{service_component_name}``
-------------------------------------------------------

Description
+++++++++++

.. raw:: html

    Binds the configuration for service_component_name and returns the bound configuration, policies, and any other keys that are in Consul

Parameters
++++++++++

.. csv-table::
    :delim: |
    :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
    :widths: 20, 15, 10, 10, 10, 20, 30

    service_component_name | path | Yes | string |  |  | Service Component Name. service_component_name must be a key in consul.

Request
+++++++

Responses
+++++++++

**200**
^^^^^^^

OK; returns {config : ..., policies : ....., k : ...} for all other k in Consul

.. _i_4d863967ef9a9d9efdadd1b250c76bd6:

**Response Schema:**

**Example:**

.. code-block:: javascript

    {}

**404**
^^^^^^^

there is no configuration in Consul for this component

GET ``/service_component/{service_component_name}``
---------------------------------------------------

Description
+++++++++++

.. raw:: html

    Binds the configuration for service_component_name and returns the bound configuration as a JSON

Parameters
++++++++++

.. csv-table::
    :delim: |
    :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
    :widths: 20, 15, 10, 10, 10, 20, 30

    service_component_name | path | Yes | string |  |  | Service Component Name. service_component_name must be a key in consul.

Request
+++++++

Responses
+++++++++

**200**
^^^^^^^

OK; the bound config is returned as an object

**Response Schema:**

**Example:**

.. code-block:: javascript

    {}

**404**
^^^^^^^

there is no configuration in Consul for this component

GET ``/{key}/{service_component_name}``
---------------------------------------

Description
+++++++++++

.. raw:: html

    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.

Parameters
++++++++++

.. csv-table::
    :delim: |
    :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
    :widths: 20, 15, 10, 10, 10, 20, 30

    key | path | Yes | string |  |  | this endpoint tries to pull service_component_name:key; key is the key after the colon
    service_component_name | path | Yes | string |  |  | Service Component Name.

Request
+++++++

Responses
+++++++++

**200**
^^^^^^^

OK; returns service_component_name:key

**Response Schema:**

**Example:**

.. code-block:: javascript

    {}

**400**
^^^^^^^

bad request. Currently this is only returned on :policies, which is a complex
object, and should be gotten through service_component_all

**404**
^^^^^^^

key does not exist

GET ``/healthcheck``
--------------------

Description
+++++++++++

.. raw:: html

    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

Request
+++++++

Responses
+++++++++

**200**
^^^^^^^

Successful response

**503**
^^^^^^^

the config binding service cannot reach Consul