@@ -18,7 +18,15 @@ def add_routes(self, app: web.Application):
18
18
router .add_patch ('/config/main' , self .update_main_config )
19
19
router .add_patch ('/config/agents' , self .update_agents_config )
20
20
21
- @aiohttp_apispec .docs (tags = ['config' ])
21
+ @aiohttp_apispec .docs (tags = ['config' ], summary = 'Retrieve Config' ,
22
+ parameters = [{
23
+ 'in' : 'path' ,
24
+ 'name' : 'name' ,
25
+ 'schema' : {'type' : 'string' },
26
+ 'required' : 'true' ,
27
+ 'description' : 'Name of the configuration file to be retrieved.'
28
+ }],
29
+ description = 'Retrieves configuration by name, as specified by {name} in the request url.' )
22
30
async def get_config_with_name (self , request ):
23
31
config_name = request .match_info ['name' ]
24
32
@@ -28,9 +36,13 @@ async def get_config_with_name(self, request):
28
36
raise JsonHttpNotFound (f'Config not found: { config_name } ' )
29
37
return web .json_response (config )
30
38
31
- @aiohttp_apispec .docs (tags = ['config' ])
39
+ @aiohttp_apispec .docs (tags = ['config' ], summary = 'Update Agent Config' ,
40
+ description = 'Use fields from the AgentConfigUpdateSchema in the request body to '
41
+ 'update the Agent Configuration file.' )
32
42
@aiohttp_apispec .request_schema (AgentConfigUpdateSchema )
33
- @aiohttp_apispec .response_schema (AgentConfigUpdateSchema )
43
+ @aiohttp_apispec .response_schema (AgentConfigUpdateSchema ,
44
+ description = 'The response consists of data from the Agent configuration file '
45
+ 'dumped in the AgentConfigUpdateSchema format.' )
34
46
async def update_agents_config (self , request ):
35
47
schema = AgentConfigUpdateSchema ()
36
48
data = await self .parse_json_body (request , schema )
@@ -39,7 +51,9 @@ async def update_agents_config(self, request):
39
51
agents_config = self ._api_manager .get_filtered_config ('agents' )
40
52
return web .json_response (schema .dump (agents_config ))
41
53
42
- @aiohttp_apispec .docs (tags = ['config' ])
54
+ @aiohttp_apispec .docs (tags = ['config' ], summary = 'Update Main Config' ,
55
+ description = 'Use fields from the ConfigUpdateSchema in the request body to '
56
+ 'update the main configuration file.' )
43
57
@aiohttp_apispec .request_schema (ConfigUpdateSchema )
44
58
async def update_main_config (self , request ):
45
59
data = await self .parse_json_body (
0 commit comments