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