Skip to content

Commit 715c106

Browse files
committed
plugins.yaml should use existing yamls
1 parent a31b8e6 commit 715c106

File tree

3 files changed

+87
-216
lines changed

3 files changed

+87
-216
lines changed

cosmos/data/config/microservice.yaml

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,77 @@
22
MICROSERVICE:
33
summary: Defines a new microservice
44
example: MICROSERVICE EXAMPLE example-microservice
5+
description: Defines a microservice that the plugin adds to the COSMOS system. Microservices are background software processes that perform persistent processing.
56
parameters:
6-
- name: Folder Name
7+
- name: Microservice Folder Name
8+
description: The exact name of the microservice folder in the plugin. ie. microservices/<Microservice Folder Name>
79
required: true
8-
description: The target folder where the microservice is located
9-
values: .*
10-
- name: Name
10+
values: .+
11+
- name: Microservice Name
12+
description: The specific name of this instance of the microservice in the COSMOS system
1113
required: true
12-
description: The microservice name
13-
values: .*
14+
values: .+
1415
modifiers:
1516
ENV:
16-
summary: Environment variable
17+
summary: Sets an environment variable in the microservice.
1718
parameters:
18-
- name: Name
19+
- name: Key
1920
required: true
2021
description: Environment variable name
21-
values: .*
22+
values: .+
2223
- name: Value
2324
required: true
2425
description: Environment variable value
25-
values: .*
26+
values: .+
2627
WORK_DIR:
27-
summary: Directory to start the microservice in (CWD)
28+
summary: Set the working directory
29+
description: Working directory to run the microservice CMD in. Can be a path relative to the microservice folder in the plugin, or an absolute path in the container the microservice runs in.
2830
parameters:
29-
- name: Path
31+
- name: Directory
3032
required: true
31-
description: Relative path from the target directory
32-
values: .*
33+
description: Working directory to run the microservice CMD in. Can be a path relative to the microservice folder in the plugin, or an absolute path in the container the microservice runs in.
34+
values: .+
3335
TOPIC:
34-
summary: Topic the microservice should process data from
36+
summary: Associate a Redis topic
37+
description: Redis topic to associate with this microservice. Standard COSMOS microservices such as decom_microservice use this information to know what packet streams to subscribe to. The TOPIC keyword can be used as many times as necessary to associate all needed topics.
3538
parameters:
36-
- name: Name
39+
- name: Topic Name
3740
required: true
38-
description: Topic name
39-
values: .*
41+
description: Redis Topic to associate with the microservice
42+
values: .+
4043
TARGET_NAME:
41-
summary: Target which this microservice processes
44+
summary: Associate a COSMOS target
45+
description: COSMOS target to associate with the microservice. For standard COSMOS microservices such as decom_microservice this causes the target configuration to get loaded into the container for the microservice.
4246
parameters:
43-
- name: Name
47+
- name: Target Name
4448
required: true
45-
description: Target name
46-
values: .*
49+
description: COSMOS target to associate with the microservice
50+
values: .+
4751
CMD:
48-
summary: Command to run which starts the microservice
52+
summary: Command line to execute to run the microservice.
53+
description: Command line to execute to run the microservice.
4954
parameters:
50-
- name: Executable
55+
- name: Args
5156
required: true
52-
description: Executable to call
53-
values: .*
54-
- name: Command parameters
55-
required: false
56-
description: Additional parameters used by the command
57+
description: One or more arguments to exec to run the microservice.
58+
values: .+
5759
OPTION:
58-
summary: Options to pass to the underlying microservice (used by InterfaceMicroservice, etc.)
60+
summary: Pass an option to the microservice
61+
description: Generic key/value(s) options to pass to the microservice. These take the form of KEYWORD/PARAMS like a line in a COSMOS configuration file. Multiple OPTION keywords can be used to pass multiple options to the microservice.
5962
parameters:
60-
- name: Name
63+
- name: Option Name
64+
required: true
65+
description: Name of the option
66+
values: .+
67+
- name: Option Value(s)
6168
required: true
62-
description: Option name
63-
values: .*
64-
- name: Values
69+
description: One or more values to associate with the option
70+
values: .+
71+
CONTAINER:
72+
summary: Docker Container.
73+
description: Container to execute and run the microservice in.
74+
parameters:
75+
- name: Args
6576
required: false
66-
description: Option values
77+
description: Name of the container
78+
values: .+

cosmos/data/config/plugins.yaml

Lines changed: 3 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -65,153 +65,6 @@ ROUTER:
6565
<%= MetaConfigParser.load('_interfaces.yaml').to_meta_config_yaml(8) %>
6666
documentation: Additional parameters are required. Please see the [Interfaces](/docs/v5/interfaces)
6767
documentation for more details.
68-
TARGET:
69-
summary: Define a target
70-
description: Defines a target that the plugin adds to the COSMOS system. Targets are entities that COSMOS can send commands to and receive telemetry from.
71-
parameters:
72-
- name: Target Folder Name
73-
description: The exact name of the target folder in the plugin. ie. targets/<Target Folder Name>
74-
required: true
75-
values: .+
76-
- name: Target Name
77-
description: The specific name of this instance of the target in the COSMOS system
78-
required: true
79-
values: .+
80-
MICROSERVICE:
81-
summary: Define a microservice
82-
description: Defines a microservice that the plugin adds to the COSMOS system. Microservices are background software processes that perform persistent processing.
83-
parameters:
84-
- name: Microservice Folder Name
85-
description: The exact name of the microservice folder in the plugin. ie. microservices/<Microservice Folder Name>
86-
required: true
87-
values: .+
88-
- name: Microservice Name
89-
description: The specific name of this instance of the microservice in the COSMOS system
90-
required: true
91-
values: .+
92-
modifiers:
93-
ENV:
94-
summary: Sets an environment variable in the microservice.
95-
description: Sets an environment variable in the microservice.
96-
parameters:
97-
- name: Key
98-
required: true
99-
description: Name of the environment variable
100-
values: .+
101-
- name: Value
102-
required: true
103-
description: Value of the environment variable
104-
values: .+
105-
WORK_DIR:
106-
summary: Set the working directory
107-
description: Working directory to run the microservice CMD in. Can be a path relative to the microservice folder in the plugin, or an absolute path in the container the microservice runs in.
108-
parameters:
109-
- name: Directory
110-
required: true
111-
description: Working directory to run the microservice CMD in. Can be a path relative to the microservice folder in the plugin, or an absolute path in the container the microservice runs in.
112-
values: .+
113-
TOPIC:
114-
summary: Associate a Redis topic
115-
description: Redis topic to associate with this microservice. Standard COSMOS microservices such as decom_microservice use this information to know what packet streams to subscribe to. The TOPIC keyword can be used as many times as necessary to associate all needed topics.
116-
parameters:
117-
- name: Topic Name
118-
required: true
119-
description: Redis Topic to associate with the microservice
120-
values: .+
121-
TARGET_NAME:
122-
summary: Associate a COSMOS target
123-
description: COSMOS target to associate with the microservice. For standard COSMOS microservices such as decom_microservice this causes the target configuration to get loaded into the container for the microservice.
124-
parameters:
125-
- name: Target Name
126-
required: true
127-
description: COSMOS target to associate with the microservice
128-
values: .+
129-
CMD:
130-
summary: Command line to execute to run the microservice.
131-
description: Command line to execute to run the microservice.
132-
parameters:
133-
- name: Args
134-
required: true
135-
description: One or more arguments to exec to run the microservice.
136-
values: .+
137-
CONTAINER:
138-
summary: Docker Container.
139-
description: Container to execute and run the microservice in.
140-
parameters:
141-
- name: Args
142-
required: false
143-
description: Name of the container
144-
values: .+
145-
OPTION:
146-
summary: Pass an option to the microservice
147-
description: Generic key/value(s) options to pass to the microservice. These take the form of KEYWORD/PARAMS like a line in a COSMOS configuration file. Multiple OPTION keywords can be used to pass multiple options to the microservice.
148-
parameters:
149-
- name: Option Name
150-
required: true
151-
description: Name of the option
152-
values: .+
153-
- name: Option Value(s)
154-
required: true
155-
description: One or more values to associate with the option
156-
values: .+
157-
TOOL:
158-
summary: Define a tool
159-
description: Defines a tool that the plugin adds to the COSMOS system. Tools are web based applications that make use of the Single-SPA javascript library that allows them to by dynamically added to the running system as independent frontend microservices.
160-
parameters:
161-
- name: Tool Folder Name
162-
description: The exact name of the tool folder in the plugin. ie. tools/<Tool Folder Name>
163-
required: true
164-
values: .+
165-
- name: Tool Name
166-
description: Name of the tool that is displayed in the COSMOS Navigation menu
167-
required: true
168-
values: .+
169-
modifiers:
170-
URL:
171-
summary: Url used to access the tool
172-
description: The relative url used to access the tool. Defaults to "/tools/<Tool Folder Name>".
173-
parameters:
174-
- name: Url
175-
required: true
176-
description: The url. If not given defaults to tools/<Tool Folder Name>. Generally should not be given unless linking to external tools.
177-
values: .+
178-
INLINE_URL:
179-
summary: Internal url to load a tool
180-
description: The url of the javascript file used to load the tool into single-SPA. Defaults to "js/app.js".
181-
parameters:
182-
- name: Url
183-
required: true
184-
description: The inline url. If not given defaults to js/app.js. Generally should not be given unless using a non-standard filename.
185-
values: .+
186-
WINDOW:
187-
summary: How to display the tool when navigated to
188-
description: The window mode used to display the tool. Currently supported modes are INLINE which opens the tool internally without refreshing the page using the Single-SPA framework, and NEW which opens the tool in a new TAB. A future release will support IFRAME to open external tools in an Iframe within COSMOS.
189-
parameters:
190-
- name: Window Mode
191-
required: true
192-
description: INLINE, NEW, or IFRAME
193-
values: .+
194-
ICON:
195-
summary: Set tool icon
196-
description: Icon shown next to the tool name in the COSMOS navigation menu.
197-
parameters:
198-
- name: Icon Name
199-
required: true
200-
description: Icon to display next to the tool name. Icons come from Font Awesome, Material Design, and Astro. See https://vuetifyjs.com/en/components/icons/
201-
values: .+
202-
CATEGORY:
203-
summary: Category for the tool
204-
description: Associates the tool with a category. In a future release this will be able to organize tools into submenus in the Navigation menu.
205-
parameters:
206-
- name: Category Name
207-
required: true
208-
description: Category to associate the tool with
209-
values: .+
210-
SHOWN:
211-
summary: Show the tool or not
212-
description: Whether or not the tool is shown in the Navigation menu. Should generally be true, except for the cosmos base tool.
213-
parameters:
214-
- name: Shown
215-
required: true
216-
description: Whether or not the tool is shown. TRUE or FALSE
217-
values: .+
68+
<%= MetaConfigParser.load('target.yaml').to_meta_config_yaml() %>
69+
<%= MetaConfigParser.load('microservice.yaml').to_meta_config_yaml() %>
70+
<%= MetaConfigParser.load('tool.yaml').to_meta_config_yaml() %>

cosmos/data/config/tool.yaml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,63 @@
11
---
22
TOOL:
3-
summary: Defines a new tool
3+
summary: Define a tool
44
example: TOOL DEMO Demo
5+
description: Defines a tool that the plugin adds to the COSMOS system. Tools are web based applications that make use of the Single-SPA javascript library that allows them to by dynamically added to the running system as independent frontend microservices.
56
parameters:
6-
- name: Folder Name
7+
- name: Tool Folder Name
8+
description: The exact name of the tool folder in the plugin. ie. tools/<Tool Folder Name>
79
required: true
8-
description: The folder where the tool is located relative to the tools folder in the plugin
9-
values: .*
10-
- name: Name
10+
values: .+
11+
- name: Tool Name
12+
description: Name of the tool that is displayed in the COSMOS Navigation menu
1113
required: true
12-
description: The tool name displayed in the Nav bar
13-
values: .*
14+
values: .+
1415
modifiers:
1516
URL:
16-
summary: Url to reach the tool relative to the tools Folder Name, or absolute
17+
summary: Url used to access the tool
18+
description: The relative url used to access the tool. Defaults to "/tools/<Tool Folder Name>".
1719
parameters:
18-
- name: URL
20+
- name: Url
1921
required: true
20-
description: URL
21-
values: .*
22+
description: The url. If not given defaults to tools/<Tool Folder Name>. Generally should not be given unless linking to external tools.
23+
values: .+
2224
INLINE_URL:
23-
summary: Single SPA url to reach the tool
24-
example: js/app.js
25+
summary: Internal url to load a tool
26+
description: The url of the javascript file used to load the tool into single-SPA. Defaults to "js/app.js".
2527
parameters:
26-
- name: URL
28+
- name: Url
2729
required: true
28-
description: URL
29-
values: .*
30-
ICON:
31-
summary: Icon used to display the tool link
32-
parameters:
33-
- name: Name
34-
required: true
35-
description: Material design icon name (https://materialdesignicons.com/)
36-
values: .*
30+
description: The inline url. If not given defaults to js/app.js. Generally should not be given unless using a non-standard filename.
31+
values: .+
3732
WINDOW:
38-
summary: How the tool should be displayed
33+
summary: How to display the tool when navigated to
34+
description: The window mode used to display the tool. INLINE opens the tool internally without refreshing the page using the Single-SPA framework. IFRAME opens external tools in an Iframe within COSMOS. NEW opens the tool in a new TAB.
3935
parameters:
40-
- name: Mode
36+
- name: Window Mode
4137
required: true
4238
description: Tool display mode
4339
values: ["INLINE", "IFRAME", "NEW"]
40+
ICON:
41+
summary: Set tool icon
42+
description: Icon shown next to the tool name in the COSMOS navigation menu.
43+
parameters:
44+
- name: Icon Name
45+
required: true
46+
description: Icon to display next to the tool name. Icons come from Font Awesome, Material Design (https://materialdesignicons.com/), and Astro.
47+
values: .+
4448
CATEGORY:
45-
summary: Category to place the tool into
49+
summary: Category for the tool
50+
description: Associates the tool with a category. In a future release this will be able to organize tools into submenus in the Navigation menu.
4651
parameters:
47-
- name: Category
52+
- name: Category Name
4853
required: true
49-
description: Name of a category to organize a tool into
50-
values: .*
54+
description: Category to associate the tool with
55+
values: .+
5156
SHOWN:
52-
summary: Is the Tool Shown in the Nav Bar
57+
summary: Show the tool or not
58+
description: Whether or not the tool is shown in the Navigation menu. Should generally be true, except for the cosmos base tool.
5359
parameters:
5460
- name: Shown
5561
required: true
56-
description: Is Shown?
62+
description: Whether or not the tool is shown. TRUE or FALSE
5763
values: ["true", "false"]

0 commit comments

Comments
 (0)