blob: 1d3e7884040834dce20444c2b22747ff07111ddb [file] [log] [blame]
Lusheng Jib2a561b2018-03-27 23:24:33 -04001# ============LICENSE_START=======================================================
2# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
3# ================================================================================
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15# ============LICENSE_END=========================================================
Vijay VK86cd8932018-10-23 16:35:29 +010016
Lusheng Jib2a561b2018-03-27 23:24:33 -040017
18
19---
20swagger: "2.0"
21info:
Vijay VK86cd8932018-10-23 16:35:29 +010022 version: "2.2.3"
Lusheng Jib2a561b2018-03-27 23:24:33 -040023 title: "Config Binding Service"
24paths:
25 /service_component/{service_component_name}:
26 parameters:
27 - name: "service_component_name"
28 in: "path"
29 description: "Service Component Name. service_component_name must be a key in consul."
30 required: true
31 type: "string"
32 get:
33 description: "Binds the configuration for service_component_name and returns the bound configuration as a JSON"
34 operationId: "config_binding_service.controller.bind_config_for_scn"
35 responses:
36 200:
37 description: OK; the bound config is returned as an object
38 schema:
39 type: object
40 404:
41 description: there is no configuration in Consul for this component
42
43 /service_component_all/{service_component_name}:
44 parameters:
45 - name: "service_component_name"
46 in: "path"
47 description: "Service Component Name. service_component_name must be a key in consul."
48 required: true
49 type: "string"
50 get:
51 description: "Binds the configuration for service_component_name and returns the bound configuration, policies, and any other keys that are in Consul"
52 operationId: "config_binding_service.controller.bind_all"
53 responses:
54 200:
55 description: "OK; returns {config : ..., policies : ....., k : ...} for all other k in Consul"
56 schema:
57 type: object
58 404:
59 description: there is no configuration in Consul for this component
60
61 /{key}/{service_component_name}:
62 parameters:
63 - name: "key"
64 in: "path"
65 description: "this endpoint tries to pull service_component_name:key; key is the key after the colon"
66 required: true
67 type: "string"
68 - name: "service_component_name"
69 in: "path"
70 description: "Service Component Name."
71 required: true
72 type: "string"
73 get:
74 description: "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."
75 operationId: "config_binding_service.controller.get_key"
76 responses:
77 200:
78 description: "OK; returns service_component_name:key"
79 schema:
80 type: object
81 404:
82 description: "key does not exist"
83 schema:
84 type: string
85 400:
86 description: "bad request. Currently this is only returned on :policies, which is a complex object, and should be gotten through service_component_all"
87 schema:
88 type: string
89
90 /healthcheck:
91 get:
92 description: "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"
93 operationId: "config_binding_service.controller.healthcheck"
94 parameters: []
95 responses:
96 200:
97 description: Successful response
98 503:
99 description: the config binding service cannot reach Consul