blob: cfe0944032a6ee4c424bc355c4bbb078c331a97d [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=========================================================
16#
17# ECOMP is a trademark and service mark of AT&T Intellectual Property.
18
19
20---
21swagger: "2.0"
22info:
23 version: "2.1.0"
24 title: "Config Binding Service"
25paths:
26 /service_component/{service_component_name}:
27 parameters:
28 - name: "service_component_name"
29 in: "path"
30 description: "Service Component Name. service_component_name must be a key in consul."
31 required: true
32 type: "string"
33 get:
34 description: "Binds the configuration for service_component_name and returns the bound configuration as a JSON"
35 operationId: "config_binding_service.controller.bind_config_for_scn"
36 responses:
37 200:
38 description: OK; the bound config is returned as an object
39 schema:
40 type: object
41 404:
42 description: there is no configuration in Consul for this component
43
44 /service_component_all/{service_component_name}:
45 parameters:
46 - name: "service_component_name"
47 in: "path"
48 description: "Service Component Name. service_component_name must be a key in consul."
49 required: true
50 type: "string"
51 get:
52 description: "Binds the configuration for service_component_name and returns the bound configuration, policies, and any other keys that are in Consul"
53 operationId: "config_binding_service.controller.bind_all"
54 responses:
55 200:
56 description: "OK; returns {config : ..., policies : ....., k : ...} for all other k in Consul"
57 schema:
58 type: object
59 404:
60 description: there is no configuration in Consul for this component
61
62 /{key}/{service_component_name}:
63 parameters:
64 - name: "key"
65 in: "path"
66 description: "this endpoint tries to pull service_component_name:key; key is the key after the colon"
67 required: true
68 type: "string"
69 - name: "service_component_name"
70 in: "path"
71 description: "Service Component Name."
72 required: true
73 type: "string"
74 get:
75 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."
76 operationId: "config_binding_service.controller.get_key"
77 responses:
78 200:
79 description: "OK; returns service_component_name:key"
80 schema:
81 type: object
82 404:
83 description: "key does not exist"
84 schema:
85 type: string
86 400:
87 description: "bad request. Currently this is only returned on :policies, which is a complex object, and should be gotten through service_component_all"
88 schema:
89 type: string
90
91 /healthcheck:
92 get:
93 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"
94 operationId: "config_binding_service.controller.healthcheck"
95 parameters: []
96 responses:
97 200:
98 description: Successful response
99 503:
100 description: the config binding service cannot reach Consul