blob: a29610f5033c531332efc032bf5d7d82541310d3 [file] [log] [blame]
Ralph Knag1fca6ac2017-12-05 12:05:57 -05001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3
4.. _common-specification:
5
6Common Elements of the Component Specification
7==============================================
8
9This page describes the component specification (JSON) sections that are
10common to both Docker and CDAP components. Differences for each are
11pointed out below. Elements that are very different, and described in
12the CDAP or Docker specific pages.
13
14.. _metadata:
15
16Component Metadata
17------------------
18
19Metadata refers to the properties found under the ``self`` JSON. This
20group of properties is used to uniquely identify this component
21specification and identify the component that this specification is used
22to capture.
23
24Example:
25
26::
27
28 "self": {
29 "version": "1.0.0",
30 "name": "asimov.component.kpi_anomaly",
31 "description": "Classifies VNF KPI data as anomalous",
32 "component_type": "docker"
33 },
34
35``self`` Schema:
36
37+-------------+--------+----------------+
38| Property | Type | Description |
39| Name | | |
40+=============+========+================+
41| version | string | *Required*. |
42| | | Semantic |
43| | | version |
44| | | for this |
45| | | specification |
46+-------------+--------+----------------+
47| name | string | *Required*. |
48| | | Full |
49| | | name of |
50| | | this |
51| | | component |
52| | | which is |
53| | | also |
54| | | used as |
55| | | this |
56| | | component's |
57| | | catalog |
58| | | id. |
59+-------------+--------+----------------+
60| description | string | *Required* |
61| | | Human-readable |
62| | | text |
63| | | describing |
64| | | the |
65| | | component |
66| | | and the |
67| | | components |
68| | | functional |
69| | | purpose. |
70+-------------+--------+----------------+
71| component_t\| string | *Required* |
72| ype | | Identify |
73| | | what |
74| | | containe\ |
75| | | rization |
76| | | technolo\ |
77| | | gy |
78| | | this |
79| | | componen\ |
80| | | t |
81| | | uses: |
82| | | *docker* |
83| | | or |
84| | | *cdap*. |
85| | | |
86+-------------+--------+----------------+
87
88.. _interfaces:
89
90Interfaces
91----------
92
93Interfaces are the JSON objects found under the ``streams`` key and the
94``services`` key. These are used to describe the interfaces that the
95component uses and the interfaces that the component provides. The
96description of each interface includes the associated :any:`data
97format <data-formats>`.
98
99Streams
100~~~~~~~
101
102- The ``streams`` JSON is for specifying data produced for consumption
103 by other components, and the streams expected to subscribe to that is
104 produced by other components. These are “fire and forget” type
105 interfaces where the publisher of a stream does not expect or parse a
106 response from the subscriber.
107- The term ``stream`` here is abstract and neither refers to “CDAP
108 streams” or “DMaaP feeds”. While a stream is very likely a DMaaP
109 feed, it could be a direct stream of data being routed via HTTP too.
110 It abstractly refers to a sequence of data leaving a publisher.
111- Streams have anonymous publish/subscribe semantics, which decouples
112 the production of information from its consumption.
113- In general, components are not aware of who they are communicating
114 with.
115- Instead, components that are interested in data, subscribe to the
116 relevant stream; components that generate data publish to the
117 relevant stream.
118- There can be multiple publishers and subscribers to a stream. Streams
119 are intended for unidirectional, streaming communication.
120
121Streams interfaces that implement an HTTP endpoint must support POST.
122
123Streams are split into:
124
125+-------------+----+----------+
126| Property | Ty\| Descript\|
127| Name | pe | ion |
128+=============+====+==========+
129| subscribes | JS\| *Require\|
130| | ON | d*. |
131| | li\| List of |
132| | st | all |
133| | | availabl\|
134| | | e |
135| | | stream |
136| | | interfac\|
137| | | es |
138| | | that |
139| | | this |
140| | | componen\|
141| | | t |
142| | | has that |
143| | | can be |
144| | | used for |
145| | | subscrib\|
146| | | ing |
147+-------------+----+----------+
148| publishes | JS\| *Require\|
149| | ON | d*. |
150| | li\| List of |
151| | st | all |
152| | | stream |
153| | | interfac\|
154| | | es |
155| | | that |
156| | | this |
157| | | componen\|
158| | | t |
159| | | will |
160| | | publish |
161| | | onto |
162+-------------+----+----------+
163
164Subscribes
165^^^^^^^^^^
166
167Example:
168
169.. code:: json
170
171 "streams": {
172 "subscribes": [{
173 "format": "dcae.vnf.kpi",
174 "version": "1.0.0",
175 "route": "/data", // for CDAP this value is not used
176 "type": "http"
177 }],
178 ...
179 }
180
181This describes that ``asimov.component.kpi_anomaly`` exposes an HTTP
182endpoint called ``/data`` which accepts requests that have the data
183format of ``dcae.vnf.kpi`` version ``1.0.0``.
184
185``subscribes`` Schema:
186
187+-------------+----+--------------------+
188| Property | Ty\| Descript\ |
189| Name | pe | ion |
190+=============+====+====================+
191| format | st\| *Require\ |
192| | ri\| d*. |
193| | ng | Data |
194| | | format |
195| | | id of |
196| | | the data |
197| | | format |
198| | | that is |
199| | | used by |
200| | | this |
201| | | interfac\ |
202| | | e |
203+-------------+----+--------------------+
204| version | st\| *Require\ |
205| | ri\| d*. |
206| | ng | Data |
207| | | format |
208| | | version |
209| | | of the |
210| | | data |
211| | | format |
212| | | that is |
213| | | used by |
214| | | this |
215| | | interfac\ |
216| | | e |
217+-------------+----+--------------------+
218| route | st\| *Require\ |
219| | ri\| d |
220| | ng | for HTTP |
221| | | and data |
222| | | router*. |
223| | | The HTTP |
224| | | route |
225| | | that |
226| | | this |
227| | | interfac\ |
228| | | e |
229| | | listens |
230| | | on |
231+-------------+----+--------------------+
232| config_key | st\| *Require\ |
233| | ri\| d \ |
234| | ng | for \ |
235| | | message_router\ |
236| | | and data \ |
237| | | router*. |
238| | | The HTTP |
239| | | route |
240| | | that |
241| | | this |
242| | | interfac\ |
243| | | e |
244| | | listens |
245| | | on |
246+-------------+----+--------------------+
247| type | st\| *Require\ |
248| | ri\| d*. |
249| | ng | Type of |
250| | | stream: |
251| | | ``http`` |
252| | | , |
253| | | ``message_router`` |
254| | | , |
255| | | ``data_router`` |
256+-------------+----+--------------------+
257
258.. _message-router:
259
260Message router
261''''''''''''''
262
263Message router subscribers are http clients rather than http services
264and performs a http a ``GET`` call. Thus, message router subscribers
265description is structured like message router publishers and requires
266``config_key``:
267
268.. code:: json
269
270 "streams": {
271 "subscribes": [{
272 "format": "dcae.some-format",
273 "version": "1.0.0",
274 "config_key": "some_format_handle",
275 "type": "message router"
276 }],
277 ...
278 }
279
280
281.. _data-router:
282
283Data router
284'''''''''''
285
286Data router subscribers are http or https services that handle ``PUT``
287requests from data router. Developers must provide the ``route`` or url
288path/endpoint that is expected to handle data router requests. This will
289be used to construct the delivery url needed to register the subscriber
290to the provisioned feed. Developers must also provide a ``config_key``
291because there is dynamic configuration information associated with the
292feed that the application will need e.g. username and password. See the
293page on :doc:`DMaaP connection objects <../dcae-cli/dmaap-connection-objects>` for more details on
294the configuration information.
295
296Example (not tied to the larger example):
297
298.. code:: json
299
300 "streams": {
301 "subscribes": [{
302 "config_key": "some-sub-dr",
303 "format": "sandbox.platform.any",
304 "route": "/identity",
305 "type": "data_router",
306 "version": "0.1.0"
307 }],
308 ...
309 }
310
311Publishes
312^^^^^^^^^
313
314Example:
315
316.. code:: json
317
318 "streams": {
319 ...
320 "publishes": [{
321 "format": "asimov.format.integerClassification",
322 "version": "1.0.0",
323 "config_key": "prediction",
324 "type": "http"
325 }]
326 },
327
328This describes that ``asimov.component.kpi_anomaly`` publishes by making
329POST requests to streams that support the data format
330``asimov.format.integerClassification`` version ``1.0.0``.
331
332``publishes`` Schema:
333
334+-------------+----+--------------------+
335| Property | Ty\| Descript\ |
336| Name | pe | ion |
337+=============+====+====================+
338| format | st\| *Require\ |
339| | ri\| d*. |
340| | ng | Data |
341| | | format |
342| | | id of |
343| | | the data |
344| | | format |
345| | | that is |
346| | | used by |
347| | | this |
348| | | interfac\ |
349| | | e |
350+-------------+----+--------------------+
351| version | st\| *Require\ |
352| | ri\| d*. |
353| | ng | Data |
354| | | format |
355| | | version |
356| | | of the |
357| | | data |
358| | | format |
359| | | that is |
360| | | used by |
361| | | this |
362| | | interfac\ |
363| | | e |
364+-------------+----+--------------------+
365| config_key | st\| *Require\ |
366| | ri\| d*. |
367| | ng | The JSON |
368| | | key in |
369| | | the |
370| | | generate\ |
371| | | d |
372| | | applicat |
373| | | ion |
374| | | configur\ |
375| | | ation |
376| | | that |
377| | | will be |
378| | | used to |
379| | | pass the |
380| | | downstre\ |
381| | | am |
382| | | componen\ |
383| | | t’s |
384| | | (the |
385| | | subscrib\ |
386| | | er’s) |
387| | | connecti\ |
388| | | on |
389| | | informat\ |
390| | | ion. |
391+-------------+----+--------------------+
392| type | st\| *Require\ |
393| | ri\| d*. |
394| | ng | Type of |
395| | | stream: |
396| | | ``http`` |
397| | | , |
398| | | ``message_router`` |
399| | | , |
400| | | ``data_router`` |
401+-------------+----+--------------------+
402
403.. message-router-1:
404
405Message router
406''''''''''''''
407
408Message router publishers are http clients of DMaap message_router.
409Developers must provide a ``config_key`` because there is dynamic
410configuration information associated with the feed that the application
411will need to receive e.g. topic url, username, password. See the page on
412:doc:`DMaaP connection objects <../dcae-cli/dmaap-connection-objects>` for more details on
413the configuration information.
414
415Example (not tied to the larger example):
416
417.. code:: json
418
419 "streams": {
420 ...
421 "publishes": [{
422 "config_key": "some-pub-mr",
423 "format": "sandbox.platform.any",
424 "type": "message_router",
425 "version": "0.1.0"
426 }]
427 }
428
429.. data-router-1:
430
431Data router
432'''''''''''
433
434Data router publishers are http clients that make ``PUT`` requests to
435data router. Developers must also provide a ``config_key`` because there
436is dynamic configuration information associated with the feed that the
437application will need to receive e.g. publish url, username, password.
438See the page on :doc:`DMaaP connection objects <../dcae-cli/dmaap-connection-objects>` for more details on
439the configuration information.
440
441Example (not tied to the larger example):
442
443.. code:: json
444
445 "streams": {
446 ...
447 "publishes": [{
448 "config_key": "some-pub-dr",
449 "format": "sandbox.platform.any",
450 "type": "data_router",
451 "version": "0.1.0"
452 }]
453 }
454
455Quick Reference
456^^^^^^^^^^^^^^^
457
458Refer to this :doc:`Quick Reference <streams-grid>` for a
459comparison of the Streams ‘Publishes’ and ‘Subscribes’ sections.
460
461Services
462~~~~~~~~
463
464- The publish / subscribe model is a very flexible communication
465 paradigm, but its many-to-many one-way transport is not appropriate
466 for RPC request / reply interactions, which are often required in a
467 distributed system.
468- Request / reply is done via a Service, which is defined by a pair of
469 messages: one for the request and one for the reply.
470
471Services are split into:
472
473+-------------+----+----------+
474| Property | Ty\| Descript\|
475| Name | pe | ion |
476+=============+====+==========+
477| calls | JS\| *Require\|
478| | ON | d*. |
479| | li\| List of |
480| | st | all |
481| | | service |
482| | | interfac\|
483| | | es |
484| | | that |
485| | | this |
486| | | componen\|
487| | | t |
488| | | will |
489| | | call |
490+-------------+----+----------+
491| provides | JS\| *Require\|
492| | ON | d*. |
493| | li\| List of |
494| | st | all |
495| | | service |
496| | | interfac\|
497| | | es |
498| | | that |
499| | | this |
500| | | componen\|
501| | | t |
502| | | exposes |
503| | | and |
504| | | provides |
505+-------------+----+----------+
506
507Calls
508^^^^^
509
510The JSON ``services/calls`` is for specifying that the component relies
511on an HTTP(S) service—the component sends that service an HTTP request,
512and that service responds with an HTTP reply. An example of this is how
513string matching (SM) depends on the AAI Broker. SM performs a
514synchronous REST call to the AAI broker, providing it the VMNAME of the
515VNF, and the AAI Broker responds with additional details about the VNF.
516This dependency is expressed via ``services/calls``. In contrast, the
517output of string matching (the alerts it computes) is sent directly to
518policy as a fire-and-forget interface, so that is an example of a
519``stream``.
520
521Example:
522
523.. code:: json
524
525 "services": {
526 "calls": [{
527 "config_key": "vnf-db",
528 "request": {
529 "format": "dcae.vnf.meta",
530 "version": "1.0.0"
531 },
532 "response": {
533 "format": "dcae.vnf.kpi",
534 "version": "1.0.0"
535 }
536 }],
537 ...
538 }
539
540This describes that ``asimov.component.kpi_anomaly`` will make HTTP
541calls to a downstream component that accepts requests of data format
542``dcae.vnf.meta`` version ``1.0.0`` and is expecting the response to be
543``dcae.vnf.kpi`` version ``1.0.0``.
544
545``calls`` Schema:
546
547+-------------+----+----------+
548| Property | Ty\| Descript\|
549| Name | pe | ion |
550+=============+====+==========+
551| request | JS\| *Require\|
552| | ON | d*. |
553| | ob\| Descript\|
554| | je\| ion |
555| | ct | of the |
556| | | expected |
557| | | request |
558| | | for this |
559| | | downstre\|
560| | | am |
561| | | interfac\|
562| | | e |
563+-------------+----+----------+
564| response | JS\| *Require\|
565| | ON | d*. |
566| | ob\| Descript\|
567| | je\| ion |
568| | ct | of the |
569| | | expected |
570| | | response |
571| | | for this |
572| | | downstre\|
573| | | am |
574| | | interfac\|
575| | | e |
576+-------------+----+----------+
577| config_key | st\| *Require\|
578| | ri\| d*. |
579| | ng | The JSON |
580| | | key in |
581| | | the |
582| | | generate\|
583| | | d |
584| | | applicat |
585| | | ion |
586| | | configur\|
587| | | ation |
588| | | that |
589| | | will be |
590| | | used to |
591| | | pass the |
592| | | downstre\|
593| | | am |
594| | | componen |
595| | | t |
596| | | connecti\|
597| | | on |
598| | | informat\|
599| | | ion. |
600+-------------+----+----------+
601
602The JSON object schema for both ``request`` and ``response``:
603
604+-------------+----+----------+
605| Property | Ty\| Descript\|
606| Name | pe | ion |
607+=============+====+==========+
608| format | st\| *Require\|
609| | ri\| d*. |
610| | ng | Data |
611| | | format |
612| | | id of |
613| | | the data |
614| | | format |
615| | | that is |
616| | | used by |
617| | | this |
618| | | interfac\|
619| | | e |
620+-------------+----+----------+
621| version | st\| *Require\|
622| | ri\| d*. |
623| | ng | Data |
624| | | format |
625| | | version |
626| | | of the |
627| | | data |
628| | | format |
629| | | that is |
630| | | used by |
631| | | this |
632| | | interfac\|
633| | | e |
634+-------------+----+----------+
635
636Provides
637^^^^^^^^
638
639Example:
640
641.. code:: json
642
643 "services": {
644 ...
645 "provides": [{
646 "route": "/score-vnf",
647 "request": {
648 "format": "dcae.vnf.meta",
649 "version": "1.0.0"
650 },
651 "response": {
652 "format": "asimov.format.integerClassification",
653 "version": "1.0.0"
654 }
655 }]
656 },
657
658This describes that ``asimov.component.kpi_anomaly`` provides a service
659interface and it is exposed on the ``/score-vnf`` HTTP endpoint. The
660endpoint accepts requests that have the data format ``dcae.vnf.meta``
661version ``1.0.0`` and gives back a response of
662``asimov.format.integerClassification`` version ``1.0.0``.
663
664``provides`` Schema for a Docker component:
665
666+-------------+----+----------+
667| Property | Ty\| Descript\|
668| Name | pe | ion |
669+=============+====+==========+
670| request | JS\| *Require\|
671| | ON | d*. |
672| | ob\| Descript\|
673| | je\| ion |
674| | ct | of the |
675| | | expected |
676| | | request |
677| | | for this |
678| | | interfac\|
679| | | e |
680+-------------+----+----------+
681| response | JS\| *Require\|
682| | ON | d*. |
683| | ob\| Descript\|
684| | je\| ion |
685| | ct | of the |
686| | | expected |
687| | | response |
688| | | for this |
689| | | interfac\|
690| | | e |
691+-------------+----+----------+
692| route | st\| *Require\|
693| | ri\| d*. |
694| | ng | The HTTP |
695| | | route |
696| | | that |
697| | | this |
698| | | interfac\|
699| | | e |
700| | | listens |
701| | | on |
702+-------------+----+----------+
703
704The JSON object schema for both ``request`` and ``response``:
705
706+-------------+----+----------+
707| Property | Ty\| Descript\|
708| Name | pe | ion |
709+=============+====+==========+
710| format | st\| *Require\|
711| | ri\| d*. |
712| | ng | Data |
713| | | format |
714| | | id of |
715| | | the data |
716| | | format |
717| | | that is |
718| | | used by |
719| | | this |
720| | | interfac\|
721| | | e |
722+-------------+----+----------+
723| version | st\| *Require\|
724| | ri\| d*. |
725| | ng | Data |
726| | | format |
727| | | version |
728| | | of the |
729| | | data |
730| | | format |
731| | | that is |
732| | | used by |
733| | | this |
734| | | interfac\|
735| | | e |
736+-------------+----+----------+
737
738Note, for CDAP, there is a slight variation due to the way CDAP exposes
739services:
740
741::
742
743 "provides":[ // note this is a list of JSON
744 {
745 "request":{ ...},
746 "response":{ ...},
747 "service_name":"name CDAP service",
748 "service_endpoint":"greet", // E.g the URL is /services/service_name/methods/service_endpoint
749 "verb":"GET" // GET, PUT, or POST
750 }
751 ]
752
753``provides`` Schema for a CDAP component:
754
755+-------------+----+-----------+
756| Property | Ty\| Descript\ |
757| Name | pe | ion |
758+=============+====+===========+
759| request | JS\| *Require\ |
760| | ON | d*. |
761| | ob\| Descript\ |
762| | je\| ion |
763| | ct | of the |
764| | | expected |
765| | | request |
766| | | data |
767| | | format |
768| | | for this |
769| | | interfac\ |
770| | | e |
771+-------------+----+-----------+
772| response | JS\| *Require\ |
773| | ON | d*. |
774| | ob\| Descript\ |
775| | je\| ion |
776| | ct | of the |
777| | | expected |
778| | | response |
779| | | for this |
780| | | interfac\ |
781| | | e |
782+-------------+----+-----------+
783| service_nam\| st\| *Require\ |
784| e | ri\| d*. |
785| | ng | The CDAP |
786| | | service |
787| | | name (eg |
788| | | “Greetin\ |
789| | | g”) |
790+-------------+----+-----------+
791| service_end | st\| *Require\ |
792| point | ri\| d*. |
793| | ng | The CDAP |
794| | | service |
795| | | endpoint |
796| | | for this |
797| | | service_n\|
798| | | ame |
799| | | (eg |
800| | | “/greet” |
801| | | ) |
802+-------------+----+-----------+
803| verb | st\| *Require\ |
804| | ri\| d*. |
805| | ng | ‘GET’, |
806| | | ‘PUT’ or |
807| | | ‘POST’ |
808+-------------+----+-----------+
809
810Parameters
811----------
812
813``parameters`` is where to specify the component’s application
814configuration parameters that are not connection information.
815
816+---------------+------------+----------------------------------+
817| Property Name | Type | Description |
818+===============+============+==================================+
819| parameters | JSON array | Each entry is a parameter object |
820+---------------+------------+----------------------------------+
821
822Parameter object has the following available properties:
823
824+--------------+----+----------+------+
825| Property | Ty\| Descript\| Defa\|
826| Name | pe | ion | ult |
827+==============+====+==========+======+
828| name | st\| *Require\| |
829| | ri\| d*. | |
830| | ng | The | |
831| | | property | |
832| | | name | |
833| | | that | |
834| | | will be | |
835| | | used as | |
836| | | the key | |
837| | | in the | |
838| | | generate\| |
839| | | d | |
840| | | config | |
841+--------------+----+----------+------+
842| value | an\| *Require\| |
843| | y | d*. | |
844| | | The | |
845| | | default | |
846| | | value | |
847| | | for the | |
848| | | given | |
849| | | paramete\| |
850| | | r | |
851+--------------+----+----------+------+
852| description | st\| *Require\| |
853| | ri\| d*. | |
854| | ng | Human-re\| |
855| | | adable | |
856| | | text | |
857| | | describi\| |
858| | | ng | |
859| | | the | |
860| | | paramete\| |
861| | | r | |
862| | | like | |
863| | | what its | |
864| | | for | |
865+--------------+----+----------+------+
866| type | st\| The | |
867| | ri\| required | |
868| | ng | data | |
869| | | type for | |
870| | | the | |
871| | | paramete\| |
872| | | r | |
873+--------------+----+----------+------+
874| required | bo\| An | true |
875| | ol\| optional | |
876| | ea\| key that | |
877| | n | declares | |
878| | | a | |
879| | | paramete\| |
880| | | r | |
881| | | as | |
882| | | required | |
883| | | (true) | |
884| | | or not | |
885| | | (false) | |
886+--------------+----+----------+------+
887| constraints | ar\| The | |
888| | ra\| optional | |
889| | y | list of | |
890| | | sequence | |
891| | | d | |
892| | | constrai\| |
893| | | nt | |
894| | | clauses | |
895| | | for the | |
896| | | paramete\| |
897| | | r. | |
898| | | See | |
899| | | below | |
900+--------------+----+----------+------+
901| entry_schem\ | st\| The | |
902| a | ri\| optional | |
903| | ng | key that | |
904| | | is used | |
905| | | to | |
906| | | declare | |
907| | | the name | |
908| | | of the | |
909| | | Datatype | |
910| | | definiti\| |
911| | | on | |
912| | | for | |
913| | | entries | |
914| | | of set | |
915| | | types | |
916| | | such as | |
917| | | the | |
918| | | TOSCA | |
919| | | ‘list’ | |
920| | | or | |
921| | | ‘map’. | |
922| | | Only 1 | |
923| | | level is | |
924| | | supporte\| |
925| | | d | |
926| | | at this | |
927| | | time | |
928+--------------+----+----------+------+
929| designer_ed\ | bo\| An | true |
930| itable | ol\| optional | |
931| | ea\| key that | |
932| | n | declares | |
933| | | a | |
934| | | paramete\| |
935| | | r | |
936| | | to be | |
937| | | editable | |
938| | | by | |
939| | | designer | |
940| | | (true) | |
941| | | or not | |
942| | | (false) | |
943+--------------+----+----------+------+
944| sourced_at_d\| bo\| An | fals\|
945| eployment | ol\| optional | e |
946| | ea\| key that | |
947| | n | declares | |
948| | | a | |
949| | | paramete\| |
950| | | r’s | |
951| | | value to | |
952| | | be | |
953| | | assigned | |
954| | | at | |
955| | | deployme\| |
956| | | nt | |
957| | | time | |
958| | | (true) | |
959+--------------+----+----------+------+
960| policy_edit\ | bo\| An | true |
961| able | ol\| optional | |
962| | ea\| key that | |
963| | n | declares | |
964| | | a | |
965| | | paramete\| |
966| | | r | |
967| | | to be | |
968| | | editable | |
969| | | by | |
970| | | policy | |
971| | | (true) | |
972| | | or not | |
973| | | (false) | |
974+--------------+----+----------+------+
975| policy_sche\ | ar\| The | |
976| ma | ra\| optional | |
977| | y | list of | |
978| | | schema | |
979| | | definiti\| |
980| | | ons | |
981| | | used for | |
982| | | policy. | |
983| | | See | |
984| | | below | |
985+--------------+----+----------+------+
986
987Example:
988
989.. code:: json
990
991 "parameters": [
992 {
993 "name": "threshold",
994 "value": 0.75,
995 "description": "Probability threshold to exceed to be anomalous"
996 }
997 ]
998
999Many of the parameter properties have been copied from TOSCA model
1000property definitions and are to be used for service design composition
1001and policy creation. See `section 3.5.8 *Property
1002definition* <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.1/TOSCA-Simple-Profile-YAML-v1.1.html>`__.
1003
1004The property ``constraints`` is a list of objects where each constraint
1005object:
1006
1007+--------------+----+----------+
1008| Property | Ty\| Descript\|
1009| Name | pe | ion |
1010+==============+====+==========+
1011| equal | | Constrai\|
1012| | | ns |
1013| | | a |
1014| | | property |
1015| | | or |
1016| | | paramete\|
1017| | | r |
1018| | | to a |
1019| | | value |
1020| | | equal to |
1021| | | (‘=’) |
1022| | | the |
1023| | | value |
1024| | | declared |
1025+--------------+----+----------+
1026| greater_tha\ | nu\| Constrai\|
1027| n | mb\| ns |
1028| | er | a |
1029| | | property |
1030| | | or |
1031| | | paramete |
1032| | | r |
1033| | | to a |
1034| | | value |
1035| | | greater |
1036| | | than |
1037| | | (‘>’) |
1038| | | the |
1039| | | value |
1040| | | declared |
1041+--------------+----+----------+
1042| greater_or_e\| nu\| Constrai\|
1043| qual | mb\| ns |
1044| | er | a |
1045| | | property |
1046| | | or |
1047| | | paramete\|
1048| | | r |
1049| | | to a |
1050| | | value |
1051| | | greater |
1052| | | than or |
1053| | | equal to |
1054| | | (‘>=’) |
1055| | | the |
1056| | | value |
1057| | | declared |
1058+--------------+----+----------+
1059| less_than | nu\| Constrai\|
1060| | mb\| ns |
1061| | er | a |
1062| | | property |
1063| | | or |
1064| | | paramete\|
1065| | | r |
1066| | | to a |
1067| | | value |
1068| | | less |
1069| | | than |
1070| | | (‘<’) |
1071| | | the |
1072| | | value |
1073| | | declared |
1074+--------------+----+----------+
1075| less_or_equ\ | nu\| Constrai\|
1076| al | mb\| ns |
1077| | er | a |
1078| | | property |
1079| | | or |
1080| | | paramete\|
1081| | | r |
1082| | | to a |
1083| | | value |
1084| | | less |
1085| | | than or |
1086| | | equal to |
1087| | | (‘<=’) |
1088| | | the |
1089| | | value |
1090| | | declared |
1091+--------------+----+----------+
1092| valid_value\ | ar\| Constrai\|
1093| s | ra\| ns |
1094| | y | a |
1095| | | property |
1096| | | or |
1097| | | paramete\|
1098| | | r |
1099| | | to a |
1100| | | value |
1101| | | that is |
1102| | | in the |
1103| | | list of |
1104| | | declared |
1105| | | values |
1106+--------------+----+----------+
1107| length | nu\| Constrai\|
1108| | mb\| ns |
1109| | er | the |
1110| | | property |
1111| | | or |
1112| | | paramete\|
1113| | | r |
1114| | | to a |
1115| | | value of |
1116| | | a given |
1117| | | length |
1118+--------------+----+----------+
1119| min_length | nu\| Constrai\|
1120| | mb\| ns |
1121| | er | the |
1122| | | property |
1123| | | or |
1124| | | paramete\|
1125| | | r |
1126| | | to a |
1127| | | value to |
1128| | | a |
1129| | | minimum |
1130| | | length |
1131+--------------+----+----------+
1132| max_length | nu\| Constrai\|
1133| | mb\| ns |
1134| | er | the |
1135| | | property |
1136| | | or |
1137| | | paramete\|
1138| | | r |
1139| | | to a |
1140| | | value to |
1141| | | a |
1142| | | maximum |
1143| | | length |
1144+--------------+----+----------+
1145
1146``threshold`` is the configuration parameter and will get set to 0.75
1147when the configuration gets generated.
1148
1149The property ``policy_schema`` is a list of objects where each
1150policy_schema object:
1151
1152+-------------+----+----------+------+
1153| Property | Ty\| Descript\| Defa\|
1154| Name | pe | ion | ult |
1155+=============+====+==========+======+
1156| name | st\| *Require\| |
1157| | ri\| d*. | |
1158| | ng | paramete\| |
1159| | | r | |
1160| | | name | |
1161+-------------+----+----------+------+
1162| value | st\| default | |
1163| | ri\| value | |
1164| | ng | for the | |
1165| | | paramete\| |
1166| | | r | |
1167+-------------+----+----------+------+
1168| description | st\| paramete\| |
1169| | ri\| r | |
1170| | ng | descript\| |
1171| | | ion | |
1172+-------------+----+----------+------+
1173| type | en\| *Require\| |
1174| | um | d*. | |
1175| | | data | |
1176| | | type of | |
1177| | | the | |
1178| | | paramete\| |
1179| | | r, | |
1180| | | ‘string’ | |
1181| | | , | |
1182| | | ‘number’ | |
1183| | | , | |
1184| | | ‘boolean | |
1185| | | ’, | |
1186| | | ‘datetim\| |
1187| | | e’, | |
1188| | | ‘list’, | |
1189| | | or ‘map’ | |
1190+-------------+----+----------+------+
1191| required | bo\| is | true |
1192| | ol\| paramete\| |
1193| | ea\| r | |
1194| | n | required | |
1195| | | or not? | |
1196+-------------+----+----------+------+
1197| constraints | ar\| The | |
1198| | ra\| optional | |
1199| | y | list of | |
1200| | | sequence\| |
1201| | | d | |
1202| | | constrai\| |
1203| | | nt | |
1204| | | clauses | |
1205| | | for the | |
1206| | | paramete\| |
1207| | | r. | |
1208| | | See | |
1209| | | above | |
1210+-------------+----+----------+------+
1211| entry_schem\| st\| The | |
1212| a | ri\| optional | |
1213| | ng | key that | |
1214| | | is used | |
1215| | | to | |
1216| | | declare | |
1217| | | the name | |
1218| | | of the | |
1219| | | Datatype | |
1220| | | definiti\| |
1221| | | on | |
1222| | | for | |
1223| | | certain | |
1224| | | types. | |
1225| | | entry_sc\| |
1226| | | hema | |
1227| | | must be | |
1228| | | defined | |
1229| | | when the | |
1230| | | type is | |
1231| | | either | |
1232| | | list or | |
1233| | | map. If | |
1234| | | the type | |
1235| | | is list | |
1236| | | and the | |
1237| | | entry | |
1238| | | type is | |
1239| | | a simple | |
1240| | | type | |
1241| | | (string, | |
1242| | | number, | |
1243| | | bookean, | |
1244| | | datetime | |
1245| | | ), | |
1246| | | follow | |
1247| | | with an | |
1248| | | string | |
1249| | | to | |
1250| | | describe | |
1251| | | the | |
1252| | | entry | |
1253+-------------+----+----------+------+
1254| | If | | |
1255| | th\| | |
1256| | e | | |
1257| | ty\| | |
1258| | pe | | |
1259| | is | | |
1260| | li\| | |
1261| | st | | |
1262| | an\| | |
1263| | d | | |
1264| | th\| | |
1265| | e | | |
1266| | en\| | |
1267| | tr\| | |
1268| | y | | |
1269| | ty\| | |
1270| | pe | | |
1271| | is | | |
1272| | a | | |
1273| | ma\| | |
1274| | p, | | |
1275| | fo\| | |
1276| | ll\| | |
1277| | ow | | |
1278| | wi\| | |
1279| | th | | |
1280| | an | | |
1281| | ar\| | |
1282| | ra\| | |
1283| | y | | |
1284| | to | | |
1285| | de\| | |
1286| | sc\| | |
1287| | ri\| | |
1288| | be | | |
1289| | th\| | |
1290| | e | | |
1291| | ke\| | |
1292| | ys | | |
1293| | fo\| | |
1294| | r | | |
1295| | th\| | |
1296| | e | | |
1297| | en\| | |
1298| | tr\| | |
1299| | y | | |
1300| | ma\| | |
1301| | p | | |
1302+-------------+----+----------+------+
1303| | If | | |
1304| | th\| | |
1305| | e | | |
1306| | ty\| | |
1307| | pe | | |
1308| | is | | |
1309| | li\| | |
1310| | st | | |
1311| | an\| | |
1312| | d | | |
1313| | th\| | |
1314| | e | | |
1315| | en\| | |
1316| | tr\| | |
1317| | y | | |
1318| | ty\| | |
1319| | pe | | |
1320| | is | | |
1321| | a | | |
1322| | li\| | |
1323| | st | | |
1324| | , | | |
1325| | th\| | |
1326| | at | | |
1327| | is | | |
1328| | no\| | |
1329| | t | | |
1330| | cu\| | |
1331| | rr\| | |
1332| | en\| | |
1333| | tl\| | |
1334| | y | | |
1335| | su\| | |
1336| | pp\| | |
1337| | or\| | |
1338| | te\| | |
1339| | d \| | |
1340+-------------+----+----------+------+
1341| | If | | |
1342| | th\| | |
1343| | e | | |
1344| | ty\| | |
1345| | pe | | |
1346| | is | | |
1347| | ma\| | |
1348| | p, | | |
1349| | fo\| | |
1350| | ll\| | |
1351| | ow | | |
1352| | wi\| | |
1353| | th | | |
1354| | an | | |
1355| | ar\| | |
1356| | ay | | |
1357| | to | | |
1358| | de\| | |
1359| | sc\| | |
1360| | ri\| | |
1361| | be | | |
1362| | th\| | |
1363| | e | | |
1364| | ke\| | |
1365| | ys | | |
1366| | fo\| | |
1367| | r | | |
1368| | th\| | |
1369| | e | | |
1370| | ma\| | |
1371| | p | | |
1372+-------------+----+----------+------+
1373
1374Generated Application Configuration
1375-----------------------------------
1376
1377The above example for component ``asimov.component.kpi_anomaly`` will
1378get transformed into the following application configuration JSON that
1379is fully resolved and provided at runtime by calling the
1380``config binding service``:
1381
1382.. code:: json
1383
1384 {
1385 "streams_publishes": {
1386 "prediction": ["10.100.1.100:32567"]
1387 },
1388 "streams_subscribes": {},
1389 "threshold": 0.75,
1390 "services_calls": {
1391 "vnf-db": ["10.100.1.101:32890"]
1392 }
1393 }
1394
1395.. _artifacts:
1396
1397Artifacts
1398---------
1399
1400``artifacts`` contains a list of artifacts associated with this
1401component. For Docker, this is the full path (including the registry) to
1402the Docker image. For CDAP, this is the full path to the CDAP jar.
1403
1404+---------------+------------+---------------------------------+
1405| Property Name | Type | Description |
1406+===============+============+=================================+
1407| artifacts | JSON array | Each entry is a artifact object |
1408+---------------+------------+---------------------------------+
1409
1410``artifact`` Schema:
1411
1412+---------------+--------+--------------------------------------------+
1413| Property Name | Type | Description |
1414+===============+========+============================================+
1415| uri | string | *Required*. Uri to the artifact, full path |
1416+---------------+--------+--------------------------------------------+
1417| type | string | *Required*. ``docker image`` or ``jar`` |
1418+---------------+--------+--------------------------------------------+