blob: 3bdeabcfac5c9f04b783d4e692344c0558164d2f [file] [log] [blame]
Dan Timoney53afd942017-11-08 11:54:38 -05001--- Service Logic Interpreter --- Dan Timoney --- 2014-11-12 ---
2
3Supported node types
4====================
5
6The following built-in node types are currently supported:
7
8- Flow Control
9
10 - `**block** <#Block_node>`__
11
12 - `**call** <#Call_node>`__
13
14 - `**for** <#For_node>`__
15
16 - `**return** <#Return_node>`__
17
18 - `**set** <#Set_node>`__
19
20 - `**switch** <#Switch_node>`__
21
22- Device Management
23
24 - `**configure** <#Configure_node>`__
25
26- Java Plugin Support
27
28 - `**execute** <#Execute_node>`__
29
30- Recording
31
32 - `**record** <#Record_node>`__
33
34- Resource Management
35
36 - `**delete** <#Delete_node>`__
37
38 - `**exists** <#Exists_node>`__
39
40 - `**get-resource** <#Get-resource_node>`__
41
42 - `**is-available** <#Is-available_node>`__
43
44 - `**notify** <#Notify_node>`__
45
46 - `**release** <#Release_node>`__
47
48 - `**reserve** <#Reserve_node>`__
49
50 - `**save** <#Save_node>`__
51
52 - `**update** <#Update_node>`__
53
54Flow Control
55------------
56
57Block node
58~~~~~~~~~~
59
60Description
61^^^^^^^^^^^
62
63A **block** node is used to executes a set of nodes.
64
65Attributes
66^^^^^^^^^^
67
68+--------------+-----------------------------------------------------------------------------------------------------------------------------------+
69| **atomic** | if *true*, then if a node returns failure, subsequent nodes will not be executed and nodes already executed will be backed out. |
70+--------------+-----------------------------------------------------------------------------------------------------------------------------------+
71
72Parameters
73^^^^^^^^^^
74
75None
76
77Outcomes
78^^^^^^^^
79
80None
81
82Example
83^^^^^^^
84
85::
86
87 <block>
88 <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
89 <parameter name="file" value="/tmp/sample_r1.log" />
90 <parameter name="field1" value="__TIMESTAMP__"/>
91 <parameter name="field2" value="RESERVED"/>
92 <parameter name="field3" value="$asePort.uni_circuit_id"/>
93 </record>
94 <return status="success">
95 <parameter name="uni-circuit-id" value="$asePort.uni_circuit_id" />
96 </return>
97 </block>
98
99Call node
100~~~~~~~~~
101
102Description
103^^^^^^^^^^^
104
105A **call** node is used to call another graph
106
107Attributes
108^^^^^^^^^^
109
110+---------------+------------------------------------------------------------------------------------+
111| **module** | Module of directed graph to call. If unset, defaults to that of calling graph |
112+---------------+------------------------------------------------------------------------------------+
113| **rpc** | rpc of directed graph to call. |
114+---------------+------------------------------------------------------------------------------------+
115| **version** | version of graph to call, If unset, uses active version. |
116+---------------+------------------------------------------------------------------------------------+
117| **mode** | mode (sync/async) of graph to call. If unset, defaults to that of calling graph. |
118+---------------+------------------------------------------------------------------------------------+
119
120Parameters
121^^^^^^^^^^
122
123Not applicable
124
125Outcomes
126^^^^^^^^
127
128+-----------------+------------------------------+
129| **success** | Sub graph returned success |
130+-----------------+------------------------------+
131| **not-found** | Graph not found |
132+-----------------+------------------------------+
133| **failure** | Subgraph returned success |
134+-----------------+------------------------------+
135
136Table: .
137
138Example
139^^^^^^^
140
141::
142
143 <call rpc="svc-topology-reserve" mode="sync" />
144
145For node
146~~~~~~~~
147
148Description
149^^^^^^^^^^^
150
151A **for** node provides a fixed iteration looping mechanism, similar to
152the Java for loop
153
154Attributes
155^^^^^^^^^^
156
157+-------------+------------------+
158| **index** | index variable |
159+-------------+------------------+
160| **start** | initial value |
161+-------------+------------------+
162| **end** | maximum value |
163+-------------+------------------+
164
165Parameters
166^^^^^^^^^^
167
168Not applicable.
169
170Outcomes
171^^^^^^^^
172
173Not applicable. The **status** node has no outcomes.
174
175Example
176^^^^^^^
177
178::
179
180 <for index="i" start="0" end="`$service-data.universal-cpe-ft.l2-switch-interfaces_length`">
181 <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
182 <parameter name="logger" value="message-log"/>
183 <parameter name="level" value="info"/>
184 <parameter name="field1" value="`'current l2-switch-interface name is ' + $service-data.universal-cpe-ft.l2-switch-interfaces[$i].name`"/>
185 </record>
186 </for>
187
188Return node
189~~~~~~~~~~~
190
191Description
192^^^^^^^^^^^
193
194A **return** node is used to return a status to the invoking MD-SAL
195application
196
197Attributes
198^^^^^^^^^^
199
200+--------------+---------------------------------------------------+
201| **status** | Status value to return (*success* or *failure*) |
202+--------------+---------------------------------------------------+
203
204Parameters
205^^^^^^^^^^
206
207The following optional parameters may be passed to convey more detailed
208status information.
209
210+---------------------+-----------------------------------------------------------------+
211| **error-code** | A brief, usually numeric, code indicating the error condition |
212+---------------------+-----------------------------------------------------------------+
213| **error-message** | A more detailed error message |
214+---------------------+-----------------------------------------------------------------+
215
216Outcomes
217^^^^^^^^
218
219Not applicable. The **status** node has no outcomes.
220
221Example
222^^^^^^^
223
224::
225
226 <return status="failure">
227 <parameter name="error-code" value="1542" />
228 <parameter name="error-message" value="Activation failure" />
229 </return>
230
231Set node
232~~~~~~~~
233
234Description
235^^^^^^^^^^^
236
237A **set** node is used to set one or more values in the execution
238context
239
240Attributes
241^^^^^^^^^^
242
243+---------------------+-------------------------------------------------------------------------------------+
244| **only-if-unset** | If true the set node will only execute if the current value of the target is null |
245+---------------------+-------------------------------------------------------------------------------------+
246
247Parameters
248^^^^^^^^^^
249
250Values to be set are passed as parameters
251
252Outcomes
253^^^^^^^^
254
255Not applicable. The **set** node has no outcomes.
256
257Example
258^^^^^^^
259
260::
261
262 <set>
263 <parameter name="vlan" value="$network.provider-segmentation-id" />
264 </set>
265
266Switch node
267~~~~~~~~~~~
268
269Description
270^^^^^^^^^^^
271
272A **switch** node is used to make a decision based on its **test**
273attribute.
274
275Attributes
276^^^^^^^^^^
277
278+------------+---------------------+
279| **test** | Condition to test |
280+------------+---------------------+
281
282Parameters
283^^^^^^^^^^
284
285None
286
287Outcomes
288^^^^^^^^
289
290Depends on the **test** condition
291
292Example
293^^^^^^^
294
295::
296
297 <switch test="$uni-cir-units">
298 <outcome value="Mbps">
299 <reserve plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
300 resource="ase-port"
301 key="resource-emt-clli == $edge-device-clli and speed >= $uni-cir-value"
302 pfx="asePort">
303
304 <outcome value="success">
305 <return status="success">
306 <parameter name="uni-circuit-id" value="$asePort.uni_circuit_id" />
307 </return>
308 </outcome>
309 <outcome value="Other">
310 <return status="failure">
311 <parameter name="error-code" value="1010" />
312 <parameter name="error-message" value="No ports found that match criteria" />
313 </return>
314 </outcome>
315 </reserve>
316 </outcome>
317 <outcome value="Gbps">
318 <reserve plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
319 resource="ase-port"
320 key="resource-emt-clli == $edge-device-clli and speed >= $uni-cir-value*1000"
321 pfx="asePort">
322
323 <outcome value="success">
324 <return status="success">
325 <parameter name="uni-circuit-id" value="$asePort.uni_circuit_id" />
326 </return>
327 </outcome>
328 <outcome value="Other">
329 <return status="failure">
330 <parameter name="error-code" value="1010" />
331 <parameter name="error-message" value="No ports found that match criteria" />
332 </return>
333 </outcome>
334 </reserve>
335 </outcome>
336 </switch>
337
338Device Management
339-----------------
340
341Configure node
342~~~~~~~~~~~~~~
343
344Description
345^^^^^^^^^^^
346
347A **configure** node is used to configure a device.
348
349Attributes
350^^^^^^^^^^
351
352+----------------+-----------------------------------------------------------------------------------+
353| **adaptor** | Fully qualified Java class of resource adaptor to be used |
354+----------------+-----------------------------------------------------------------------------------+
355| **activate** | Activate device/interface, for devices that support a separate activation step. |
356+----------------+-----------------------------------------------------------------------------------+
357| **key** | SQL-like string specifying criteria for item to configure |
358+----------------+-----------------------------------------------------------------------------------+
359
360Parameters
361^^^^^^^^^^
362
363Specific to device adaptor.
364
365Outcomes
366^^^^^^^^
367
368+----------------------+------------------------------------------------------------------+
369| **success** | Device successfully configured |
370+----------------------+------------------------------------------------------------------+
371| **not-found** | Element to be configured does not exist. |
372+----------------------+------------------------------------------------------------------+
373| **not-ready** | Element is not in a state where it can be configured/activated |
374+----------------------+------------------------------------------------------------------+
375| **already-active** | Attempt to activate element that is already active |
376+----------------------+------------------------------------------------------------------+
377| **failure** | Configure failed for some other reason |
378+----------------------+------------------------------------------------------------------+
379
380Example
381^^^^^^^
382
383::
384
385 <configure adaptor="org.onap.ccsdk.sli.adaptors.emt.EmtAdaptor"
386 key="$uni-circuit-id" activate="true">
387 <parameter name="circuit.id" value="$uni-circuit-id" />
388 <parameter name="subscriber.name" value="$subscriber-name" />
389 <parameter name="emt.clli" value="$edge-device-clli" />
390 <parameter name="port.tagging" value="$port-tagging" />
391 <parameter name="port.mediaSpeed" value="$media-speed" />
392 <parameter name="location.state" value="$uni-location-state" />
393 <parameter name="location.city" value="$uni-location-city" />
394 <parameter name="cosCategory" value="$cos-category" />
395 <parameter name="gosProfile" value="$gos-profile" />
396 <parameter name="lldp" value="$asePort.resource-lldp" />
397 <parameter name="mtu" value="$asePort.resource-mtu" />
398 <outcome value="success">
399 <block>
400 <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
401 <parameter name="file" value="/tmp/sample_r1.log" />
402 <parameter name="field1" value="__TIMESTAMP__"/>
403 <parameter name="field2" value="ACTIVE"/>
404 <parameter name="field3" value="$uni-circuit-id"/>
405 </record>
406 <return status="success">
407 <parameter name="edge-device-clli" value="$asePort.resource-emt-clli" />
408 </return>
409 </block>
410 </outcome>
411 <outcome value="already-active">
412 <return status="failure">
413 <parameter name="error-code" value="1590" />
414 <parameter name="error-message" value="Port already active" />
415 </return>
416 </outcome>
417 <outcome value="Other">
418 <return status="failure">
419 <parameter name="error-code" value="1542" />
420 <parameter name="error-message" value="Activation failure" />
421 </return>
422 </outcome>
423 </configure>
424
425Java Plugin Support
426-------------------
427
428Execute node
429~~~~~~~~~~~~
430
431Description
432^^^^^^^^^^^
433
434An **execute** node is used to execute Java code supplied as a plugin
435
436Attributes
437^^^^^^^^^^
438
439+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
440| **plugin** | Fully qualified Java class of plugin to be used |
441+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
442| **method** | Name of method in the plugin class to execute. Method must return void, and take 2 arguments: a Map (for parameters) and a SvcLogicContext (to allow plugin read/write access to context memory) |
443+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
444
445Parameters
446^^^^^^^^^^
447
448Specific to plugin / method
449
450Outcomes
451^^^^^^^^
452
453+--------------------------+-----------------------------------------------------------------+
454| **success** | Device successfully configured |
455+--------------------------+-----------------------------------------------------------------+
456| **not-found** | Plugin class could not be loaded |
457+--------------------------+-----------------------------------------------------------------+
458| **unsupported-method** | Named method taking (Map, SvcLogicContext) could not be found |
459+--------------------------+-----------------------------------------------------------------+
460| **failure** | Configure failed for some other reason |
461+--------------------------+-----------------------------------------------------------------+
462
463Example
464^^^^^^^
465
466::
467
468 <execute plugin="org.onap.ccsdk.sli.plugins.HelloWorld"
469 method="log">
470 <parameter name="message" value="Hello, world!" />
471 <outcome value="success">
472 <return status="success"/>
473 </outcome>
474 <outcome value="not-found">
475 <return status="failure">
476 <parameter name="error-code" value="1590" />
477 <parameter name="error-message" value="Could not locate plugin" />
478 </return>
479 </outcome>
480 <outcome value="Other">
481 <return status="failure">
482 <parameter name="error-code" value="1542" />
483 <parameter name="error-message" value="Internal error" />
484 </return>
485 </outcome>
486 </execute>
487
488Recording
489---------
490
491Record node
492~~~~~~~~~~~
493
494Description
495^^^^^^^^^^^
496
497A **record** node is used to record an event. For example, this might be
498used to log provisioning events.
499
500Attributes
501^^^^^^^^^^
502
503+--------------+---------------------------------------------------+
504| **plugin** | Fully qualified Java class to handle recording. |
505+--------------+---------------------------------------------------+
506
507Parameters
508^^^^^^^^^^
509
510Parameters will depend on the plugin being used. For the FileRecorder
511class, the parameters are as follows
512
513+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
514| **file** | The file to which the record should be written |
515+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
516| **field1** | First field to write. There will be **field** parameters for each field to write, from **field1** through **fieldN**. A special value \_\_TIMESTAMP\_\_ may be assigned to a field to insert the current timestamp |
517+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
518
519Outcomes
520^^^^^^^^
521
522+---------------+--------------------------------------------+
523| **success** | Record successfully written |
524+---------------+--------------------------------------------+
525| **failure** | Record could not be successfully written |
526+---------------+--------------------------------------------+
527
528Example
529^^^^^^^
530
531::
532
533 <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
534 <parameter name="file" value="/tmp/sample_r1.log" />
535 <parameter name="field1" value="__TIMESTAMP__"/>
536 <parameter name="field2" value="ACTIVE"/>
537 <parameter name="field3" value="$uni-circuit-id"/>
538 </record>
539
540Resource Management
541-------------------
542
543Delete node
544~~~~~~~~~~~
545
546Description
547^^^^^^^^^^^
548
549A **delete** node is used to delete a resource from the local resource
550inventory.
551
552Attributes
553^^^^^^^^^^
554
555+----------------+-------------------------------------------------------------+
556| **plugin** | Fully qualified Java class of resource adaptor to be used |
557+----------------+-------------------------------------------------------------+
558| **resource** | Type of resource to delete |
559+----------------+-------------------------------------------------------------+
560| **key** | SQL-like string specifying key to delete |
561+----------------+-------------------------------------------------------------+
562
563Parameters
564^^^^^^^^^^
565
566None
567
568Outcomes
569^^^^^^^^
570
571+---------------+--------------------------------------------+
572| **success** | Resource specified deleted successfully. |
573+---------------+--------------------------------------------+
574| *failure*> | Resource specified was not deleted |
575+---------------+--------------------------------------------+
576
577Example
578^^^^^^^
579
580::
581
582 <delete plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
583 resource="ase-port"
584 key="uni_circuit_id == $uni-circuit-id">
585 <outcome value="true">
586 <return status="success"/>
587 </outcome>
588 <outcome value="false">
589 <return status="failure"/>
590 </outcome>
591 </delete>
592
593Exists node
594~~~~~~~~~~~
595
596Description
597^^^^^^^^^^^
598
599An **exists** node is used to determine whether a particular instance of
600a resource exists. For example, this might be used to test whether a
601particular switch CLLI is provisioned.
602
603Attributes
604^^^^^^^^^^
605
606+----------------+-------------------------------------------------------------+
607| **plugin** | Fully qualified Java class of resource adaptor to be used |
608+----------------+-------------------------------------------------------------+
609| **resource** | Type of resource to check |
610+----------------+-------------------------------------------------------------+
611| **key** | SQL-like string specifying key to check for |
612+----------------+-------------------------------------------------------------+
613
614Parameters
615^^^^^^^^^^
616
617None
618
619Outcomes
620^^^^^^^^
621
622+-------------+---------------------------------+
623| **true** | Resource specified exists. |
624+-------------+---------------------------------+
625| **false** | Resource specified is unknown |
626+-------------+---------------------------------+
627
628Example
629^^^^^^^
630
631::
632
633 <exists plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
634 resource="ase-port"
635 key="uni_circuit_id == $uni-circuit-id">
636 <outcome value="true">
637 <return status="success"/>
638 </outcome>
639 <outcome value="false">
640 <return status="failure"/>
641 </outcome>
642 </exists>
643
644Get-resource node
645~~~~~~~~~~~~~~~~~
646
647Description
648^^^^^^^^^^^
649
650A **get-resource** node is used to retrieve information about a
651particular resource and make it available to other nodes in the service
652logic tree. For example, this might be used to retrieve information
653about a particular uni-port.
654
655Attributes
656^^^^^^^^^^
657
658+----------------+------------------------------------------------------------------------------------------+
659| **plugin** | Fully qualified Java class of resource adaptor to be used |
660+----------------+------------------------------------------------------------------------------------------+
661| **resource** | Type of resource to retrieve |
662+----------------+------------------------------------------------------------------------------------------+
663| **key** | SQL-like string specifying criteria for retrieval |
664+----------------+------------------------------------------------------------------------------------------+
665| **pfx** | Prefix to add to context variable names set for data retrieved |
666+----------------+------------------------------------------------------------------------------------------+
667| **select** | String to specify, if key matches multiple entries, which entry should take precedence |
668+----------------+------------------------------------------------------------------------------------------+
669| **order-by** | Prefix to add to context variable names set for data retrieved |
670+----------------+------------------------------------------------------------------------------------------+
671
672Parameters
673^^^^^^^^^^
674
675None
676
677Outcomes
678^^^^^^^^
679
680+-----------------+--------------------------------------------------+
681| **success** | Resource successfully retrieved |
682+-----------------+--------------------------------------------------+
683| **not-found** | Resource referenced does not exist |
684+-----------------+--------------------------------------------------+
685| **failure** | Resource retrieve failed for some other reason |
686+-----------------+--------------------------------------------------+
687
688Example
689^^^^^^^
690
691::
692
693 <get-resource plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
694 resource="ase-port"
695 key="uni_circuit_id == $uni-circuit-id"
696 pfx="current-port">
697 <outcome value="success">
698 <return status="success"/>
699 </outcome>
700 <outcome value="not-found">
701 <return status="failure"/>
702 </outcome>
703 <outcome value="failure">
704 <return status="failure"/>
705 </outcome>
706 </get-resource>
707
708Is-available node
709~~~~~~~~~~~~~~~~~
710
711Description
712^^^^^^^^^^^
713
714An **is-available** node is used to determine whether a particular type
715of resource is available. For example, this might be used to test
716whether any ports are available for assignment on a particular switch.
717
718Attributes
719^^^^^^^^^^
720
721+----------------+------------------------------------------------------------------+
722| **plugin** | Fully qualified Java class of resource adaptor to be used |
723+----------------+------------------------------------------------------------------+
724| **resource** | Type of resource to check |
725+----------------+------------------------------------------------------------------+
726| **key** | SQL-like string specifying key to check for |
727+----------------+------------------------------------------------------------------+
728| **pfx** | Prefix to add to context variable names set for data retrieved |
729+----------------+------------------------------------------------------------------+
730
731Parameters
732^^^^^^^^^^
733
734None
735
736Outcomes
737^^^^^^^^
738
739+-------------+---------------------------------------+
740| **true** | Resource requested is available |
741+-------------+---------------------------------------+
742| **false** | Resource requested is not available |
743+-------------+---------------------------------------+
744
745Example
746^^^^^^^
747
748::
749
750 <is-available plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
751 resource="ase-port"
752 key="resource-emt-clli == $edge-device-clli and speed >= $uni-cir-value">
753 <outcome value="true">
754 <return status="success"/>
755 </outcome>
756 <outcome value="false">
757 <return status="failure"/>
758 </outcome>
759 </is-available>
760
761Notify node
762~~~~~~~~~~~
763
764Description
765^^^^^^^^^^^
766
767A **notify** node is used to inform an external application (e.g. A&AI)
768that a resource was updated.
769
770Attributes
771^^^^^^^^^^
772
773+----------------+---------------------------------------------------------------------+
774| **plugin** | Fully qualified Java class of resource adaptor to be used |
775+----------------+---------------------------------------------------------------------+
776| **resource** | Identifies resource that was updated |
777+----------------+---------------------------------------------------------------------+
778| **action** | Action that triggered notification to be sent (ADD/UPDATE/DELETE) |
779+----------------+---------------------------------------------------------------------+
780
781Parameters
782^^^^^^^^^^
783
784None
785
786Outcomes
787^^^^^^^^
788
789+---------------+----------------------------------------+
790| **success** | Notification was successful |
791+---------------+----------------------------------------+
792| **failure** | Notification failed is not available |
793+---------------+----------------------------------------+
794
795Example
796^^^^^^^
797
798::
799
800 <notify plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
801 resource="ase-port"
802 action="ADD">
803 <outcome value="success">
804 <return status="success"/>
805 </outcome>
806 <outcome value="Other">
807 <return status="failure"/>
808 </outcome>
809 </notify>
810
811Release node
812~~~~~~~~~~~~
813
814Description
815^^^^^^^^^^^
816
817A **release** node is used to mark a resource as no longer in use, and
818thus available for assignment.
819
820Attributes
821^^^^^^^^^^
822
823+----------------+------------------------------------------------------------------+
824| **plugin** | Fully qualified Java class of resource adaptor to be used |
825+----------------+------------------------------------------------------------------+
826| **resource** | Type of resource to release |
827+----------------+------------------------------------------------------------------+
828| **key** | SQL-like string specifying key to check of resource to release |
829+----------------+------------------------------------------------------------------+
830
831Parameters
832^^^^^^^^^^
833
834None
835
836Outcomes
837^^^^^^^^
838
839+-----------------+-------------------------------------------------+
840| **success** | Resource successfully released |
841+-----------------+-------------------------------------------------+
842| **not-found** | Resource referenced does not exist |
843+-----------------+-------------------------------------------------+
844| **failure** | Resource release failed for some other reason |
845+-----------------+-------------------------------------------------+
846
847Example
848^^^^^^^
849
850::
851
852 <release plugin="org.onap.ccsdk.sli.adaptors.SampleServiceResource"
853 resource="ase-port"
854 key="uni_circuit_id == $uni-circuit-id">
855 <outcome value="success">
856 <return status="success"/>
857 </outcome>
858 <outcome value="not-found">
859 <return status="failure"/>
860 </outcome>
861 <outcome value="failure">
862 <return status="failure"/>
863 </outcome>
864 </release>
865
866Reserve node
867~~~~~~~~~~~~
868
869Description
870^^^^^^^^^^^
871
872A **reserve** node is used to reserve a particular type of resource..
873For example, this might be used to reserve a port on a particular
874switch.
875
876Attributes
877^^^^^^^^^^
878
879+----------------+----------------------------------------------------------------------------------------------+
880| **plugin** | Fully qualified Java class of resource adaptor to be used |
881+----------------+----------------------------------------------------------------------------------------------+
882| **resource** | Type of resource to reserve |
883+----------------+----------------------------------------------------------------------------------------------+
884| **key** | SQL-like string specifying criteria for reservation |
885+----------------+----------------------------------------------------------------------------------------------+
886| **select** | String to specify, if **key** matches multiple entries, which entry should take precedence |
887+----------------+----------------------------------------------------------------------------------------------+
888
889Parameters
890^^^^^^^^^^
891
892None
893
894Outcomes
895^^^^^^^^
896
897+---------------+----------------------------------------------------+
898| **success** | Resource requested was successfully reserved |
899+---------------+----------------------------------------------------+
900| **failure** | Resource requested was not successfully reserved |
901+---------------+----------------------------------------------------+
902
903Example
904^^^^^^^
905
906::
907
908 <reserve plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
909 resource="ase-port"
910 key="resource-emt-clli == $edge-device-clli and speed >= $uni-cir-value"
911 select="min(speed)">
912 <outcome value="success">
913 <return status="success"/>
914 </outcome>
915 <outcome value="failure">
916 <return status="failure"/>
917 </outcome>
918 </reserve>
919
920Save node
921~~~~~~~~~
922
923Description
924^^^^^^^^^^^
925
926A **save** node is used to save information about a particular resource
927to persistent storage. For example, this might be used to save
928information about a particular uni-port.
929
930Attributes
931^^^^^^^^^^
932
933+----------------+------------------------------------------------------------------------------------------+
934| **plugin** | Fully qualified Java class of resource adaptor to be used |
935+----------------+------------------------------------------------------------------------------------------+
936| **resource** | Type of resource to save |
937+----------------+------------------------------------------------------------------------------------------+
938| **key** | SQL-like string specifying criteria for retrieval |
939+----------------+------------------------------------------------------------------------------------------+
940| **force** | If "true", save resource even if this resource is already stored in persistent storage |
941+----------------+------------------------------------------------------------------------------------------+
942| **pfx** | Prefix to be prepended to variable names, when attributes are set in SvcLogicContext |
943+----------------+------------------------------------------------------------------------------------------+
944
945Parameters
946^^^^^^^^^^
947
948Values to save (columns) are specified as parameters, with each name
949corresponding to a column name and each value corresponding to the value
950to set.
951
952Outcomes
953^^^^^^^^
954
955+---------------+-------------------------------+
956| **success** | Resource successfully saved |
957+---------------+-------------------------------+
958| **failure** | Resource save failed |
959+---------------+-------------------------------+
960
961Example
962^^^^^^^
963
964::
965
966 <save plugin="`$sample-resource-plugin`" resource="vnf"
967 key="vnf-name = $requests.vnf.vnf-name" force="true"
968 pfx="requests.vnf">
969 <parameter name="vnf-name"
970 value="`$requests.cust-country-code + $requests.cust-id + $requests.cust-city + $requests.cust-state + '001VCE'`" />
971 <parameter name="vnf-type" value="vce" />
972 <parameter name="orchestration-status" value="pending-create" />
973 <parameter name="heat-stack-id" value="`$requests.heat-stack-id`" />
974 <parameter name="mso-catalog-key" value="`$requests.mso-catalog-key`" />
975 <parameter name="oam-ipv4-address" value="`$vce-ipv4-oam-addr.ipv4-addr`" />
976 </save>
977
978Update node
979~~~~~~~~~~~
980
981Description
982^^^^^^^^^^^
983
984An **update** node is used to update information about a particular
985resource to persistent storage.
986
987Attributes
988^^^^^^^^^^
989
990+----------------+----------------------------------------------------------------------------------------+
991| **plugin** | Fully qualified Java class of resource adaptor to be used |
992+----------------+----------------------------------------------------------------------------------------+
993| **resource** | Type of resource to update |
994+----------------+----------------------------------------------------------------------------------------+
995| **key** | SQL-like string specifying criteria for retrieval |
996+----------------+----------------------------------------------------------------------------------------+
997| **pfx** | Prefix to be prepended to variable names, when attributes are set in SvcLogicContext |
998+----------------+----------------------------------------------------------------------------------------+
999
1000Parameters
1001^^^^^^^^^^
1002
1003Values to save (columns) are specified as parameters, with each name
1004corresponding to a column name and each value corresponding to the value
1005to set.
1006
1007Outcomes
1008^^^^^^^^
1009
1010+---------------+-------------------------------+
1011| **success** | Resource successfully saved |
1012+---------------+-------------------------------+
1013| **failure** | Resource save failed |
1014+---------------+-------------------------------+
1015
1016Example
1017^^^^^^^
1018
1019::
1020
1021 <update plugin="`$sample-resource-plugin`" resource="vnf"
1022 key="vnf-name = $requests.vnf.vnf-name"
1023 pfx="requests.vnf">
1024 <parameter name="vnf-name"
1025 value="`$requests.cust-country-code + $requests.cust-id + $requests.cust-city + $requests.cust-state + '001VCE'`" />
1026 <parameter name="vnf-type" value="vce" />
1027 <parameter name="orchestration-status" value="pending-create" />
1028 <parameter name="heat-stack-id" value="`$requests.heat-stack-id`" />
1029 <parameter name="mso-catalog-key" value="`$requests.mso-catalog-key`" />
1030 <parameter name="oam-ipv4-address" value="`$vce-ipv4-oam-addr.ipv4-addr`" />
1031 </update>