908b05da3741366847f222f562b6d3d652ace90c
[policy/parent.git] / docs / clamp / acm / design-impl / participants / tosca / tosca-http-participant.yml
1 tosca_definitions_version: tosca_simple_yaml_1_3
2 data_types:
3   onap.datatypes.ToscaConceptIdentifier:
4     derived_from: tosca.datatypes.Root
5     properties:
6       name:
7         type: string
8         required: true
9       version:
10         type: string
11         required: true
12   onap.datatype.controlloop.Target:
13     derived_from: tosca.datatypes.Root
14     description: Definition for a entity in A&AI to perform a control loop operation on
15     properties:
16       targetType:
17         type: string
18         description: Category for the target type
19         required: true
20         constraints:
21           - valid_values:
22               - VNF
23               - VM
24               - VFMODULE
25               - PNF
26       entityIds:
27         type: map
28         description: |
29           Map of values that identify the resource. If none are provided, it is assumed that the
30           entity that generated the ONSET event will be the target.
31         required: false
32         metadata:
33           clamp_possible_values: ClampExecution:CSAR_RESOURCES
34         entry_schema:
35           type: string
36   onap.datatype.controlloop.Actor:
37     derived_from: tosca.datatypes.Root
38     description: An actor/operation/target definition
39     properties:
40       actor:
41         type: string
42         description: The actor performing the operation.
43         required: true
44         metadata:
45           clamp_possible_values: Dictionary:DefaultActors,ClampExecution:CDS/actor
46       operation:
47         type: string
48         description: The operation the actor is performing.
49         metadata:
50           clamp_possible_values: Dictionary:DefaultOperations,ClampExecution:CDS/operation
51         required: true
52       target:
53         type: onap.datatype.controlloop.Target
54         description: The resource the operation should be performed on.
55         required: true
56       payload:
57         type: map
58         description: Name/value pairs of payload information passed by Policy to the actor
59         required: false
60         metadata:
61           clamp_possible_values: ClampExecution:CDS/payload
62         entry_schema:
63           type: string
64   onap.datatype.controlloop.Operation:
65     derived_from: tosca.datatypes.Root
66     description: An operation supported by an actor
67     properties:
68       id:
69         type: string
70         description: Unique identifier for the operation
71         required: true
72       description:
73         type: string
74         description: A user-friendly description of the intent for the operation
75         required: false
76       operation:
77         type: onap.datatype.controlloop.Actor
78         description: The definition of the operation to be performed.
79         required: true
80       timeout:
81         type: integer
82         description: The amount of time for the actor to perform the operation.
83         required: true
84       retries:
85         type: integer
86         description: The number of retries the actor should attempt to perform the operation.
87         required: true
88         default: 0
89       success:
90         type: string
91         description: Points to the operation to invoke on success. A value of "final_success" indicates and end to the operation.
92         required: false
93         default: final_success
94       failure:
95         type: string
96         description: Points to the operation to invoke on Actor operation failure.
97         required: false
98         default: final_failure
99       failure_timeout:
100         type: string
101         description: Points to the operation to invoke when the time out for the operation occurs.
102         required: false
103         default: final_failure_timeout
104       failure_retries:
105         type: string
106         description: Points to the operation to invoke when the current operation has exceeded its max retries.
107         required: false
108         default: final_failure_retries
109       failure_exception:
110         type: string
111         description: Points to the operation to invoke when the current operation causes an exception.
112         required: false
113         default: final_failure_exception
114       failure_guard:
115         type: string
116         description: Points to the operation to invoke when the current operation is blocked due to guard policy enforcement.
117         required: false
118         default: final_failure_guard
119   org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest:
120     version: 1.0.0
121     derived_from: tosca.datatypes.Root
122     properties:
123       restRequestId:
124         type:  onap.datatypes.ToscaConceptIdentifier
125         type_version: 0.0.0
126         required: true
127         description: The name and version of a REST request to be sent to a REST endpoint
128       httpMethod:
129         type: string
130         required: true
131         constraints:
132           - valid_values: [POST, PUT, GET, DELETE]
133         description: The REST method to use
134       path:
135         type: string
136         required: true
137         description: The path of the REST request relative to the base URL
138       body:
139         type: string
140         required: false
141         description: The body of the REST request for PUT and POST requests
142       expectedResponse:
143         type: integer
144         required: true
145         constraints:
146           - in_range: [100, 599]
147         description: THe expected HTTP status code for the REST request
148   org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.ConfigurationEntity:
149     version: 1.0.0
150     derived_from: tosca.datatypes.Root
151     properties:
152       configurationEntityId:
153         type:  onap.datatypes.ToscaConceptIdentifier
154         type_version: 0.0.0
155         required: true
156         description: The name and version of a Configuration Entity to be handled by the HTTP Control Loop Element
157       restSequence:
158         type: list
159         entry_schema:
160           type: org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest
161           type_version: 1.0.0
162         description: A sequence of REST commands to send to the REST endpoint
163 node_types:
164   org.onap.policy.clamp.controlloop.Participant:
165     version: 1.0.1
166     derived_from: tosca.nodetypes.Root
167     properties:
168       provider:
169         type: string
170         required: false
171   org.onap.policy.clamp.controlloop.ControlLoopElement:
172     version: 1.0.1
173     derived_from: tosca.nodetypes.Root
174     properties:
175       provider:
176         type: string
177         required: false
178         metadata:
179           common: true
180         description: Specifies the organization that provides the control loop element
181       participant_id:
182         type: onap.datatypes.ToscaConceptIdentifier
183         required: true
184         metadata:
185           common: true
186       participantType:
187         type: onap.datatypes.ToscaConceptIdentifier
188         required: true
189         metadata:
190           common: true
191         description: The identity of the participant type that hosts this type of Control Loop Element
192       startPhase:
193         type: integer
194         required: false
195         constraints:
196           - greater_or_equal: 0
197         metadata:
198           common: true
199         description: A value indicating the start phase in which this control loop element will be started, the
200           first start phase is zero. Control Loop Elements are started in their start_phase order and stopped
201           in reverse start phase order. Control Loop Elements with the same start phase are started and
202           stopped simultaneously
203       uninitializedToPassiveTimeout:
204         type: integer
205         required: false
206         constraints:
207           - greater_or_equal: 0
208         default: 60
209         metadata:
210           common: true
211         description: The maximum time in seconds to wait for a state chage from uninitialized to passive
212       passiveToRunningTimeout:
213         type: integer
214         required: false
215         constraints:
216           - greater_or_equal: 0
217         default: 60
218         metadata:
219           common: true
220         description: The maximum time in seconds to wait for a state chage from passive to running
221       runningToPassiveTimeout:
222         type: integer
223         required: false
224         constraints:
225           - greater_or_equal: 0
226         default: 60
227         metadata:
228           common: true
229         description: The maximum time in seconds to wait for a state chage from running to passive
230       passiveToUninitializedTimeout:
231         type: integer
232         required: false
233         constraints:
234           - greater_or_equal: 0
235         default: 60
236         metadata:
237           common: true
238         description: The maximum time in seconds to wait for a state chage from passive to uninitialized
239   org.onap.policy.clamp.controlloop.ControlLoop:
240     version: 1.0.1
241     derived_from: tosca.nodetypes.Root
242     properties:
243       provider:
244         type: string
245         required: false
246         metadata:
247           common: true
248         description: Specifies the organization that provides the control loop element
249       elements:
250         type: list
251         required: true
252         metadata:
253           common: true
254         entry_schema:
255           type: onap.datatypes.ToscaConceptIdentifier
256         description: Specifies a list of control loop element definitions that make up this control loop definition
257   org.onap.policy.clamp.controlloop.HttpControlLoopElement:
258     version: 1.0.1
259     derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
260     properties:
261       baseUrl:
262         type: string
263         required: true
264         description: The base URL to be prepended to each path, identifies the host for the REST endpoints.
265       httpHeaders:
266         type: map
267         required: false
268         entry_schema:
269           type: string
270         description: HTTP headers to send on REST requests
271       configurationEntities:
272         type: map
273         required: true
274         entry_schema:
275           type: org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.ConfigurationEntity
276           type_version: 1.0.0
277         description: The connfiguration entities the Control Loop Element is managing and their associated REST requests
278
279 topology_template:
280   node_templates:
281     org.onap.controlloop.HttpControlLoopParticipant:
282       version: 2.3.4
283       type: org.onap.policy.clamp.controlloop.Participant
284       type_version: 1.0.1
285       description: Participant for Http requests
286       properties:
287         provider: ONAP
288     org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement:
289       # Consul http config for PMSH.
290       version: 1.2.3
291       type: org.onap.policy.clamp.controlloop.HttpControlLoopElement
292       type_version: 1.0.1
293       description: Control loop element for the http requests of PMSH microservice
294       properties:
295         provider: ONAP
296         participant_id:
297           name: HttpParticipant0
298           version: 1.0.0
299         participantType:
300           name: org.onap.k8s.controlloop.HttpControlLoopParticipant
301           version: 2.3.4
302         uninitializedToPassiveTimeout: 180
303         baseUrl: http://consul-server-ui:8500
304         httpHeaders:
305           Content-Type: application/json
306         configurationEntities:
307           - configurationEntityId:
308               name: entity1
309               version: 1.0.1
310             restSequence:
311               - restRequestId:
312                   name: request1
313                   version: 1.0.1
314                 httpMethod: PUT
315                 path: v1/kv/dcae-pmsh2
316                 body: '{
317       "control_loop_name":"pmsh-control-loop",
318       "operational_policy_name":"pmsh-operational-policy",
319       "aaf_password":"demo123456!",
320       "aaf_identity":"dcae@dcae.onap.org",
321       "cert_path":"/opt/app/pmsh/etc/certs/cert.pem",
322       "key_path":"/opt/app/pmsh/etc/certs/key.pem",
323       "ca_cert_path":"/opt/app/pmsh/etc/certs/cacert.pem",
324       "enable_tls":"true",
325       "pmsh_policy":{
326          "subscription":{
327             "subscriptionName":"ExtraPM-All-gNB-R2B",
328             "administrativeState":"UNLOCKED",
329             "fileBasedGP":15,
330             "fileLocation":"\/pm\/pm.xml",
331             "nfFilter":{
332                "nfNames":[
333                   "^pnf.*",
334                   "^vnf.*"
335                ],
336                "modelInvariantIDs":[
337                ],
338                "modelVersionIDs":[
339                ],
340                "modelNames":[
341                ]
342             },
343             "measurementGroups":[
344                {
345                   "measurementGroup":{
346                      "measurementTypes":[
347                         {
348                            "measurementType":"countera"
349                         },
350                         {
351                            "measurementType":"counterb"
352                         }
353                      ],
354                      "managedObjectDNsBasic":[
355                         {
356                            "DN":"dna"
357                         },
358                         {
359                            "DN":"dnb"
360                         }
361                      ]
362                   }
363                },
364                {
365                   "measurementGroup":{
366                      "measurementTypes":[
367                         {
368                            "measurementType":"counterc"
369                         },
370                         {
371                            "measurementType":"counterd"
372                         }
373                      ],
374                      "managedObjectDNsBasic":[
375                         {
376                            "DN":"dnc"
377                         },
378                         {
379                            "DN":"dnd"
380                         }
381                      ]
382                   }
383                }
384             ]
385          }
386       },
387       "streams_subscribes":{
388          "aai_subscriber":{
389             "type":"message_router",
390             "dmaap_info":{
391                "topic_url":"https://10.152.183.151:3905/events/AAI_EVENT",
392                "client_role":"org.onap.dcae.aaiSub",
393                "location":"san-francisco",
394                "client_id":"1575976809466"
395             }
396          },
397          "policy_pm_subscriber":{
398             "type":"message_router",
399             "dmaap_info":{
400                "topic_url":"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS",
401                "client_role":"org.onap.dcae.pmSubscriber",
402                "location":"san-francisco",
403                "client_id":"1575876809456"
404             }
405          }
406       },
407       "streams_publishes":{
408          "policy_pm_publisher":{
409             "type":"message_router",
410             "dmaap_info":{
411                "topic_url":"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS",
412                "client_role":"org.onap.dcae.pmPublisher",
413                "location":"san-francisco",
414                "client_id":"1475976809466"
415             }
416          },
417          "other_publisher":{
418             "type":"message_router",
419             "dmaap_info":{
420                "topic_url":"https://10.152.183.151:3905/events/org.onap.dmaap.mr.SOME_OTHER_TOPIC",
421                "client_role":"org.onap.dcae.pmControlPub",
422                "location":"san-francisco",
423                "client_id":"1875976809466"
424             }
425          }
426       }
427    }'
428                 expectedResponse: 200
429     org.onap.domain.sample.GenericK8s_ControlLoopDefinition:
430       version: 1.2.3
431       type: org.onap.policy.clamp.controlloop.ControlLoop
432       type_version: 1.0.0
433       description: Control loop for Hello World
434       properties:
435         provider: ONAP
436         elements:
437           - name: org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement
438             version: 1.2.3