1 --- Service Logic Interpreter --- Dan Timoney --- 2014-11-12 ---
6 The following built-in node types are currently supported:
10 - `**block** <#Block_node>`__
12 - `**call** <#Call_node>`__
14 - `**for** <#For_node>`__
16 - `**return** <#Return_node>`__
18 - `**set** <#Set_node>`__
20 - `**switch** <#Switch_node>`__
24 - `**configure** <#Configure_node>`__
28 - `**execute** <#Execute_node>`__
32 - `**record** <#Record_node>`__
36 - `**delete** <#Delete_node>`__
38 - `**exists** <#Exists_node>`__
40 - `**get-resource** <#Get-resource_node>`__
42 - `**is-available** <#Is-available_node>`__
44 - `**notify** <#Notify_node>`__
46 - `**release** <#Release_node>`__
48 - `**reserve** <#Reserve_node>`__
50 - `**save** <#Save_node>`__
52 - `**update** <#Update_node>`__
63 A **block** node is used to executes a set of nodes.
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 +--------------+-----------------------------------------------------------------------------------------------------------------------------------+
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"/>
94 <return status="success">
95 <parameter name="uni-circuit-id" value="$asePort.uni_circuit_id" />
105 A **call** node is used to call another graph
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 +---------------+------------------------------------------------------------------------------------+
128 +-----------------+------------------------------+
129 | **success** | Sub graph returned success |
130 +-----------------+------------------------------+
131 | **not-found** | Graph not found |
132 +-----------------+------------------------------+
133 | **failure** | Subgraph returned success |
134 +-----------------+------------------------------+
143 <call rpc="svc-topology-reserve" mode="sync" />
151 A **for** node provides a fixed iteration looping mechanism, similar to
157 +-------------+------------------+
158 | **index** | index variable |
159 +-------------+------------------+
160 | **start** | initial value |
161 +-------------+------------------+
162 | **end** | maximum value |
163 +-------------+------------------+
173 Not applicable. The **status** node has no outcomes.
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`"/>
194 A **return** node is used to return a status to the invoking MD-SAL
200 +--------------+---------------------------------------------------+
201 | **status** | Status value to return (*success* or *failure*) |
202 +--------------+---------------------------------------------------+
207 The following optional parameters may be passed to convey more detailed
210 +---------------------+-----------------------------------------------------------------+
211 | **error-code** | A brief, usually numeric, code indicating the error condition |
212 +---------------------+-----------------------------------------------------------------+
213 | **error-message** | A more detailed error message |
214 +---------------------+-----------------------------------------------------------------+
219 Not applicable. The **status** node has no outcomes.
226 <return status="failure">
227 <parameter name="error-code" value="1542" />
228 <parameter name="error-message" value="Activation failure" />
237 A **set** node is used to set one or more values in the execution
243 +---------------------+-------------------------------------------------------------------------------------+
244 | **only-if-unset** | If true the set node will only execute if the current value of the target is null |
245 +---------------------+-------------------------------------------------------------------------------------+
250 Values to be set are passed as parameters
255 Not applicable. The **set** node has no outcomes.
263 <parameter name="vlan" value="$network.provider-segmentation-id" />
272 A **switch** node is used to make a decision based on its **test**
278 +------------+---------------------+
279 | **test** | Condition to test |
280 +------------+---------------------+
290 Depends on the **test** condition
297 <switch test="$uni-cir-units">
298 <outcome value="Mbps">
299 <reserve plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
301 key="resource-emt-clli == $edge-device-clli and speed >= $uni-cir-value"
304 <outcome value="success">
305 <return status="success">
306 <parameter name="uni-circuit-id" value="$asePort.uni_circuit_id" />
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" />
317 <outcome value="Gbps">
318 <reserve plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
320 key="resource-emt-clli == $edge-device-clli and speed >= $uni-cir-value*1000"
323 <outcome value="success">
324 <return status="success">
325 <parameter name="uni-circuit-id" value="$asePort.uni_circuit_id" />
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" />
347 A **configure** node is used to configure a device.
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 +----------------+-----------------------------------------------------------------------------------+
363 Specific to device adaptor.
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 +----------------------+------------------------------------------------------------------+
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">
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"/>
406 <return status="success">
407 <parameter name="edge-device-clli" value="$asePort.resource-emt-clli" />
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" />
417 <outcome value="Other">
418 <return status="failure">
419 <parameter name="error-code" value="1542" />
420 <parameter name="error-message" value="Activation failure" />
434 An **execute** node is used to execute Java code supplied as a plugin
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 +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
448 Specific to plugin / method
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 +--------------------------+-----------------------------------------------------------------+
468 <execute plugin="org.onap.ccsdk.sli.plugins.HelloWorld"
470 <parameter name="message" value="Hello, world!" />
471 <outcome value="success">
472 <return status="success"/>
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" />
480 <outcome value="Other">
481 <return status="failure">
482 <parameter name="error-code" value="1542" />
483 <parameter name="error-message" value="Internal error" />
497 A **record** node is used to record an event. For example, this might be
498 used to log provisioning events.
503 +--------------+---------------------------------------------------+
504 | **plugin** | Fully qualified Java class to handle recording. |
505 +--------------+---------------------------------------------------+
510 Parameters will depend on the plugin being used. For the FileRecorder
511 class, the parameters are as follows
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 +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
522 +---------------+--------------------------------------------+
523 | **success** | Record successfully written |
524 +---------------+--------------------------------------------+
525 | **failure** | Record could not be successfully written |
526 +---------------+--------------------------------------------+
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"/>
549 A **delete** node is used to delete a resource from the local resource
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 +----------------+-------------------------------------------------------------+
571 +---------------+--------------------------------------------+
572 | **success** | Resource specified deleted successfully. |
573 +---------------+--------------------------------------------+
574 | *failure*> | Resource specified was not deleted |
575 +---------------+--------------------------------------------+
582 <delete plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
584 key="uni_circuit_id == $uni-circuit-id">
585 <outcome value="true">
586 <return status="success"/>
588 <outcome value="false">
589 <return status="failure"/>
599 An **exists** node is used to determine whether a particular instance of
600 a resource exists. For example, this might be used to test whether a
601 particular switch CLLI is provisioned.
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 +----------------+-------------------------------------------------------------+
622 +-------------+---------------------------------+
623 | **true** | Resource specified exists. |
624 +-------------+---------------------------------+
625 | **false** | Resource specified is unknown |
626 +-------------+---------------------------------+
633 <exists plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
635 key="uni_circuit_id == $uni-circuit-id">
636 <outcome value="true">
637 <return status="success"/>
639 <outcome value="false">
640 <return status="failure"/>
650 A **get-resource** node is used to retrieve information about a
651 particular resource and make it available to other nodes in the service
652 logic tree. For example, this might be used to retrieve information
653 about a particular uni-port.
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 +----------------+------------------------------------------------------------------------------------------+
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 +-----------------+--------------------------------------------------+
693 <get-resource plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
695 key="uni_circuit_id == $uni-circuit-id"
697 <outcome value="success">
698 <return status="success"/>
700 <outcome value="not-found">
701 <return status="failure"/>
703 <outcome value="failure">
704 <return status="failure"/>
714 An **is-available** node is used to determine whether a particular type
715 of resource is available. For example, this might be used to test
716 whether any ports are available for assignment on a particular switch.
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 +----------------+------------------------------------------------------------------+
739 +-------------+---------------------------------------+
740 | **true** | Resource requested is available |
741 +-------------+---------------------------------------+
742 | **false** | Resource requested is not available |
743 +-------------+---------------------------------------+
750 <is-available plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
752 key="resource-emt-clli == $edge-device-clli and speed >= $uni-cir-value">
753 <outcome value="true">
754 <return status="success"/>
756 <outcome value="false">
757 <return status="failure"/>
767 A **notify** node is used to inform an external application (e.g. A&AI)
768 that a resource was updated.
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 +----------------+---------------------------------------------------------------------+
789 +---------------+----------------------------------------+
790 | **success** | Notification was successful |
791 +---------------+----------------------------------------+
792 | **failure** | Notification failed is not available |
793 +---------------+----------------------------------------+
800 <notify plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
803 <outcome value="success">
804 <return status="success"/>
806 <outcome value="Other">
807 <return status="failure"/>
817 A **release** node is used to mark a resource as no longer in use, and
818 thus available for assignment.
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 +----------------+------------------------------------------------------------------+
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 +-----------------+-------------------------------------------------+
852 <release plugin="org.onap.ccsdk.sli.adaptors.SampleServiceResource"
854 key="uni_circuit_id == $uni-circuit-id">
855 <outcome value="success">
856 <return status="success"/>
858 <outcome value="not-found">
859 <return status="failure"/>
861 <outcome value="failure">
862 <return status="failure"/>
872 A **reserve** node is used to reserve a particular type of resource..
873 For example, this might be used to reserve a port on a particular
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 +----------------+----------------------------------------------------------------------------------------------+
897 +---------------+----------------------------------------------------+
898 | **success** | Resource requested was successfully reserved |
899 +---------------+----------------------------------------------------+
900 | **failure** | Resource requested was not successfully reserved |
901 +---------------+----------------------------------------------------+
908 <reserve plugin="org.onap.ccsdk.sli.adaptors.samplesvc.SampleServiceResource"
910 key="resource-emt-clli == $edge-device-clli and speed >= $uni-cir-value"
912 <outcome value="success">
913 <return status="success"/>
915 <outcome value="failure">
916 <return status="failure"/>
926 A **save** node is used to save information about a particular resource
927 to persistent storage. For example, this might be used to save
928 information about a particular uni-port.
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 +----------------+------------------------------------------------------------------------------------------+
948 Values to save (columns) are specified as parameters, with each name
949 corresponding to a column name and each value corresponding to the value
955 +---------------+-------------------------------+
956 | **success** | Resource successfully saved |
957 +---------------+-------------------------------+
958 | **failure** | Resource save failed |
959 +---------------+-------------------------------+
966 <save plugin="`$sample-resource-plugin`" resource="vnf"
967 key="vnf-name = $requests.vnf.vnf-name" force="true"
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`" />
984 An **update** node is used to update information about a particular
985 resource to persistent storage.
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 +----------------+----------------------------------------------------------------------------------------+
1003 Values to save (columns) are specified as parameters, with each name
1004 corresponding to a column name and each value corresponding to the value
1010 +---------------+-------------------------------+
1011 | **success** | Resource successfully saved |
1012 +---------------+-------------------------------+
1013 | **failure** | Resource save failed |
1014 +---------------+-------------------------------+
1021 <update plugin="`$sample-resource-plugin`" resource="vnf"
1022 key="vnf-name = $requests.vnf.vnf-name"
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`" />