Restructure of csit files to be used both by docker and k8s config
[policy/docker.git] / csit / resources / tests / data / http-usecase.yaml
1 # ============LICENSE_START=======================================================
2 # Copyright (C) 2022 Nordix Foundation.
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 #
16 # SPDX-License-Identifier: Apache-2.0
17 # ============LICENSE_END=========================================================
18 tosca_definitions_version: tosca_simple_yaml_1_3
19 data_types:
20   onap.datatypes.ToscaConceptIdentifier:
21     derived_from: tosca.datatypes.Root
22     properties:
23       name:
24         type: string
25         required: true
26       version:
27         type: string
28         required: true
29
30   org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest:
31     version: 1.0.0
32     derived_from: tosca.datatypes.Root
33     properties:
34       restRequestId:
35         type: onap.datatypes.ToscaConceptIdentifier
36         required: true
37         description: The name and version of a REST request to be sent to a REST endpoint
38       httpMethod:
39         type: string
40         required: true
41         constraints:
42           - valid_values:
43               - POST
44               - PUT
45               - GET
46               - DELETE
47         description: The REST method to use
48       path:
49         type: string
50         required: true
51         description: The path of the REST request relative to the base URL
52       body:
53         type: string
54         required: false
55         description: The body of the REST request for PUT and POST requests
56       expectedResponse:
57         type: integer
58         required: true
59         constraints: []
60         description: THe expected HTTP status code for the REST request
61   org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity:
62     version: 1.0.0
63     derived_from: tosca.datatypes.Root
64     properties:
65       configurationEntityId:
66         type: onap.datatypes.ToscaConceptIdentifier
67         required: true
68         description: The name and version of a Configuration Entity to be handled
69           by the HTTP Automation Composition Element
70       restSequence:
71         type: list
72         entry_schema:
73           type: org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest
74           type_version: 1.0.0
75         description: A sequence of REST commands to send to the REST endpoint
76
77 node_types:
78   org.onap.policy.clamp.acm.Participant:
79     version: 1.0.1
80     derived_from: tosca.nodetypes.Root
81     properties:
82       provider:
83         type: string
84         required: false
85   org.onap.policy.clamp.acm.AutomationCompositionElement:
86     version: 1.0.1
87     derived_from: tosca.nodetypes.Root
88     properties:
89       provider:
90         type: string
91         required: false
92         metadata:
93           common: true
94         description: Specifies the organization that provides the automation composition element
95       participant_id:
96         type: onap.datatypes.ToscaConceptIdentifier
97         required: true
98         metadata:
99           common: true
100       participantType:
101         type: onap.datatypes.ToscaConceptIdentifier
102         required: true
103         metadata:
104           common: true
105         description: The identity of the participant type that hosts this type of Automation Composition Element
106       startPhase:
107         type: integer
108         required: false
109         constraints:
110           - greater_or_equal: 0
111         metadata:
112           common: true
113         description: A value indicating the start phase in which this automation composition element will be started, the
114           first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped
115           in reverse start phase order. Automation Composition Elements with the same start phase are started and
116           stopped simultaneously
117       uninitializedToPassiveTimeout:
118         type: integer
119         required: false
120         constraints:
121           - greater_or_equal: 0
122         default: 60
123         metadata:
124           common: true
125         description: The maximum time in seconds to wait for a state chage from uninitialized to passive
126       passiveToRunningTimeout:
127         type: integer
128         required: false
129         constraints:
130           - greater_or_equal: 0
131         default: 60
132         metadata:
133           common: true
134         description: The maximum time in seconds to wait for a state chage from passive to running
135       runningToPassiveTimeout:
136         type: integer
137         required: false
138         constraints:
139           - greater_or_equal: 0
140         default: 60
141         metadata:
142           common: true
143         description: The maximum time in seconds to wait for a state chage from running to passive
144       passiveToUninitializedTimeout:
145         type: integer
146         required: false
147         constraints:
148           - greater_or_equal: 0
149         default: 60
150         metadata:
151           common: true
152         description: The maximum time in seconds to wait for a state chage from passive to uninitialized
153   org.onap.policy.clamp.acm.AutomationComposition:
154     version: 1.0.1
155     derived_from: tosca.nodetypes.Root
156     properties:
157       provider:
158         type: string
159         required: false
160         metadata:
161           common: true
162         description: Specifies the organization that provides the automation composition element
163       elements:
164         type: list
165         required: true
166         metadata:
167           common: true
168         entry_schema:
169           type: onap.datatypes.ToscaConceptIdentifier
170         description: Specifies a list of automation composition element definitions that make up this automation composition definition
171   org.onap.policy.clamp.acm.HttpAutomationCompositionElement:
172     version: 1.0.1
173     derived_from: org.onap.policy.clamp.acm.AutomationCompositionElement
174     properties:
175       baseUrl:
176         type: string
177         required: true
178         description: The base URL to be prepended to each path, identifies the host for the REST endpoints.
179       httpHeaders:
180         type: map
181         required: false
182         entry_schema:
183           type: string
184         description: HTTP headers to send on REST requests
185       configurationEntities:
186         type: map
187         required: true
188         entry_schema:
189           type: org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity
190           type_version: 1.0.0
191         description: The connfiguration entities the Automation Composition Element is managing and their associated REST requests
192
193 topology_template:
194   node_templates:
195     org.onap.policy.clamp.acm.HttpParticipant:
196       version: 2.3.4
197       type: org.onap.policy.clamp.acm.Participant
198       type_version: 1.0.1
199       description: Participant for Http requests
200       properties:
201         provider: ONAP
202     onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement:
203       # Http config for AC Element Starter.
204       version: 1.2.3
205       type: org.onap.policy.clamp.acm.HttpAutomationCompositionElement
206       type_version: 1.0.1
207       description: Automation composition element for the http requests of AC Element Starter microservice
208       properties:
209         provider: ONAP
210         participant_id:
211           name: HttpParticipant0
212           version: 1.0.0
213         participantType:
214           name: org.onap.policy.clamp.acm.HttpParticipant
215           version: 2.3.4
216         uninitializedToPassiveTimeout: 180
217         startPhase: 0
218         baseUrl: http://acelement-starter:8084
219         httpHeaders:
220           Content-Type: application/json
221           Authorization: 'Basic cnVudGltZVVzZXI6emIhWHp0RzM0'
222         configurationEntities:
223           - configurationEntityId:
224               name: onap.policy.clamp.ac.starter
225               version: 1.0.0
226             restSequence:
227               - restRequestId:
228                   name: request1
229                   version: 1.0.1
230                 httpMethod: POST
231                 path: /activate
232                 body: '{ "receiverId": { "name": "onap.policy.clamp.ac.bridge", "version": "1.0.0" }, "timerMs": 4000, "elementType": "STARTER", "topicParameterGroup": { "server": "message-router", "listenerTopic": "POLICY_UPDATE_MSG", "publisherTopic": "POLICY_UPDATE_MSG", "fetchTimeout": 15000, "topicCommInfrastructure": "dmaap" } }'
233                 expectedResponse: 201
234     onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement:
235       # Http config for AC Element Bridge.
236       version: 1.2.3
237       type: org.onap.policy.clamp.acm.HttpAutomationCompositionElement
238       type_version: 1.0.1
239       description: Automation composition element for the http requests of AC Element Bridge microservice
240       properties:
241         provider: ONAP
242         participant_id:
243           name: HttpParticipant0
244           version: 1.0.0
245         participantType:
246           name: org.onap.policy.clamp.acm.HttpParticipant
247           version: 2.3.4
248         uninitializedToPassiveTimeout: 180
249         startPhase: 0
250         baseUrl: http://acelement-bridge:8084
251         httpHeaders:
252           Content-Type: application/json
253           Authorization: 'Basic cnVudGltZVVzZXI6emIhWHp0RzM0'
254         configurationEntities:
255           - configurationEntityId:
256               name: onap.policy.clamp.ac.bridge
257               version: 1.0.0
258             restSequence:
259               - restRequestId:
260                   name: request2
261                   version: 1.0.1
262                 httpMethod: POST
263                 path: /activate
264                 body: '{ "receiverId": { "name": "onap.policy.clamp.ac.sink", "version": "1.0.0" }, "timerMs": 4000, "elementType": "BRIDGE", "topicParameterGroup": { "server": "message-router", "listenerTopic": "POLICY_UPDATE_MSG", "publisherTopic": "POLICY_UPDATE_MSG", "fetchTimeout": 15000, "topicCommInfrastructure": "dmaap" } }'
265                 expectedResponse: 201
266     onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement:
267       # Http config for AC Element Sink.
268       version: 1.2.3
269       type: org.onap.policy.clamp.acm.HttpAutomationCompositionElement
270       type_version: 1.0.1
271       description: Automation composition element for the http requests of AC Element Sink microservice
272       properties:
273         provider: ONAP
274         participant_id:
275           name: HttpParticipant0
276           version: 1.0.0
277         participantType:
278           name: org.onap.policy.clamp.acm.HttpParticipant
279           version: 2.3.4
280         uninitializedToPassiveTimeout: 180
281         startPhase: 0
282         baseUrl: http://acelement-sink:8084
283         httpHeaders:
284           Content-Type: application/json
285           Authorization: 'Basic cnVudGltZVVzZXI6emIhWHp0RzM0'
286         configurationEntities:
287           - configurationEntityId:
288               name: onap.policy.clamp.ac.sink
289               version: 1.0.0
290             restSequence:
291               - restRequestId:
292                   name: request3
293                   version: 1.0.1
294                 httpMethod: POST
295                 path: /activate
296                 body: '{ "receiverId": { "name": "onap.policy.clamp.ac.sink", "version": "1.0.0" }, "timerMs": 4000, "elementType": "SINK", "topicParameterGroup": { "server": "message-router", "listenerTopic": "POLICY_UPDATE_MSG", "publisherTopic": "POLICY_UPDATE_MSG", "fetchTimeout": 15000, "topicCommInfrastructure": "dmaap" } }'
297                 expectedResponse: 201
298
299     onap.policy.clamp.ac.element.AutomationCompositionDefinition:
300       version: 1.2.3
301       type: org.onap.policy.clamp.acm.AutomationComposition
302       type_version: 1.0.1
303       description: Automation composition for Demp
304       properties:
305         provider: ONAP
306         elements:
307           - name: onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement
308             version: 1.2.3
309           - name: onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement
310             version: 1.2.3
311           - name: onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement
312             version: 1.2.3