Dan Timoney | 53afd94 | 2017-11-08 11:54:38 -0500 | [diff] [blame] | 1 | --- Service Logic Interpreter --- Dan Timoney --- 2014-11-12 --- |
| 2 | |
| 3 | Supported node types |
| 4 | ==================== |
| 5 | |
| 6 | The 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 | |
| 54 | Flow Control |
| 55 | ------------ |
| 56 | |
| 57 | Block node |
| 58 | ~~~~~~~~~~ |
| 59 | |
| 60 | Description |
| 61 | ^^^^^^^^^^^ |
| 62 | |
| 63 | A **block** node is used to executes a set of nodes. |
| 64 | |
| 65 | Attributes |
| 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 | |
| 72 | Parameters |
| 73 | ^^^^^^^^^^ |
| 74 | |
| 75 | None |
| 76 | |
| 77 | Outcomes |
| 78 | ^^^^^^^^ |
| 79 | |
| 80 | None |
| 81 | |
| 82 | Example |
| 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 | |
| 99 | Call node |
| 100 | ~~~~~~~~~ |
| 101 | |
| 102 | Description |
| 103 | ^^^^^^^^^^^ |
| 104 | |
| 105 | A **call** node is used to call another graph |
| 106 | |
| 107 | Attributes |
| 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 | |
| 120 | Parameters |
| 121 | ^^^^^^^^^^ |
| 122 | |
| 123 | Not applicable |
| 124 | |
| 125 | Outcomes |
| 126 | ^^^^^^^^ |
| 127 | |
| 128 | +-----------------+------------------------------+ |
| 129 | | **success** | Sub graph returned success | |
| 130 | +-----------------+------------------------------+ |
| 131 | | **not-found** | Graph not found | |
| 132 | +-----------------+------------------------------+ |
| 133 | | **failure** | Subgraph returned success | |
| 134 | +-----------------+------------------------------+ |
| 135 | |
| 136 | Table: . |
| 137 | |
| 138 | Example |
| 139 | ^^^^^^^ |
| 140 | |
| 141 | :: |
| 142 | |
| 143 | <call rpc="svc-topology-reserve" mode="sync" /> |
| 144 | |
| 145 | For node |
| 146 | ~~~~~~~~ |
| 147 | |
| 148 | Description |
| 149 | ^^^^^^^^^^^ |
| 150 | |
| 151 | A **for** node provides a fixed iteration looping mechanism, similar to |
| 152 | the Java for loop |
| 153 | |
| 154 | Attributes |
| 155 | ^^^^^^^^^^ |
| 156 | |
| 157 | +-------------+------------------+ |
| 158 | | **index** | index variable | |
| 159 | +-------------+------------------+ |
| 160 | | **start** | initial value | |
| 161 | +-------------+------------------+ |
| 162 | | **end** | maximum value | |
| 163 | +-------------+------------------+ |
| 164 | |
| 165 | Parameters |
| 166 | ^^^^^^^^^^ |
| 167 | |
| 168 | Not applicable. |
| 169 | |
| 170 | Outcomes |
| 171 | ^^^^^^^^ |
| 172 | |
| 173 | Not applicable. The **status** node has no outcomes. |
| 174 | |
| 175 | Example |
| 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 | |
| 188 | Return node |
| 189 | ~~~~~~~~~~~ |
| 190 | |
| 191 | Description |
| 192 | ^^^^^^^^^^^ |
| 193 | |
| 194 | A **return** node is used to return a status to the invoking MD-SAL |
| 195 | application |
| 196 | |
| 197 | Attributes |
| 198 | ^^^^^^^^^^ |
| 199 | |
| 200 | +--------------+---------------------------------------------------+ |
| 201 | | **status** | Status value to return (*success* or *failure*) | |
| 202 | +--------------+---------------------------------------------------+ |
| 203 | |
| 204 | Parameters |
| 205 | ^^^^^^^^^^ |
| 206 | |
| 207 | The following optional parameters may be passed to convey more detailed |
| 208 | status 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 | |
| 216 | Outcomes |
| 217 | ^^^^^^^^ |
| 218 | |
| 219 | Not applicable. The **status** node has no outcomes. |
| 220 | |
| 221 | Example |
| 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 | |
| 231 | Set node |
| 232 | ~~~~~~~~ |
| 233 | |
| 234 | Description |
| 235 | ^^^^^^^^^^^ |
| 236 | |
| 237 | A **set** node is used to set one or more values in the execution |
| 238 | context |
| 239 | |
| 240 | Attributes |
| 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 | |
| 247 | Parameters |
| 248 | ^^^^^^^^^^ |
| 249 | |
| 250 | Values to be set are passed as parameters |
| 251 | |
| 252 | Outcomes |
| 253 | ^^^^^^^^ |
| 254 | |
| 255 | Not applicable. The **set** node has no outcomes. |
| 256 | |
| 257 | Example |
| 258 | ^^^^^^^ |
| 259 | |
| 260 | :: |
| 261 | |
| 262 | <set> |
| 263 | <parameter name="vlan" value="$network.provider-segmentation-id" /> |
| 264 | </set> |
| 265 | |
| 266 | Switch node |
| 267 | ~~~~~~~~~~~ |
| 268 | |
| 269 | Description |
| 270 | ^^^^^^^^^^^ |
| 271 | |
| 272 | A **switch** node is used to make a decision based on its **test** |
| 273 | attribute. |
| 274 | |
| 275 | Attributes |
| 276 | ^^^^^^^^^^ |
| 277 | |
| 278 | +------------+---------------------+ |
| 279 | | **test** | Condition to test | |
| 280 | +------------+---------------------+ |
| 281 | |
| 282 | Parameters |
| 283 | ^^^^^^^^^^ |
| 284 | |
| 285 | None |
| 286 | |
| 287 | Outcomes |
| 288 | ^^^^^^^^ |
| 289 | |
| 290 | Depends on the **test** condition |
| 291 | |
| 292 | Example |
| 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 | |
| 338 | Device Management |
| 339 | ----------------- |
| 340 | |
| 341 | Configure node |
| 342 | ~~~~~~~~~~~~~~ |
| 343 | |
| 344 | Description |
| 345 | ^^^^^^^^^^^ |
| 346 | |
| 347 | A **configure** node is used to configure a device. |
| 348 | |
| 349 | Attributes |
| 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 | |
| 360 | Parameters |
| 361 | ^^^^^^^^^^ |
| 362 | |
| 363 | Specific to device adaptor. |
| 364 | |
| 365 | Outcomes |
| 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 | |
| 380 | Example |
| 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 | |
| 425 | Java Plugin Support |
| 426 | ------------------- |
| 427 | |
| 428 | Execute node |
| 429 | ~~~~~~~~~~~~ |
| 430 | |
| 431 | Description |
| 432 | ^^^^^^^^^^^ |
| 433 | |
| 434 | An **execute** node is used to execute Java code supplied as a plugin |
| 435 | |
| 436 | Attributes |
| 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 | |
| 445 | Parameters |
| 446 | ^^^^^^^^^^ |
| 447 | |
| 448 | Specific to plugin / method |
| 449 | |
| 450 | Outcomes |
| 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 | |
| 463 | Example |
| 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 | |
| 488 | Recording |
| 489 | --------- |
| 490 | |
| 491 | Record node |
| 492 | ~~~~~~~~~~~ |
| 493 | |
| 494 | Description |
| 495 | ^^^^^^^^^^^ |
| 496 | |
| 497 | A **record** node is used to record an event. For example, this might be |
| 498 | used to log provisioning events. |
| 499 | |
| 500 | Attributes |
| 501 | ^^^^^^^^^^ |
| 502 | |
| 503 | +--------------+---------------------------------------------------+ |
| 504 | | **plugin** | Fully qualified Java class to handle recording. | |
| 505 | +--------------+---------------------------------------------------+ |
| 506 | |
| 507 | Parameters |
| 508 | ^^^^^^^^^^ |
| 509 | |
| 510 | Parameters will depend on the plugin being used. For the FileRecorder |
| 511 | class, 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 | |
| 519 | Outcomes |
| 520 | ^^^^^^^^ |
| 521 | |
| 522 | +---------------+--------------------------------------------+ |
| 523 | | **success** | Record successfully written | |
| 524 | +---------------+--------------------------------------------+ |
| 525 | | **failure** | Record could not be successfully written | |
| 526 | +---------------+--------------------------------------------+ |
| 527 | |
| 528 | Example |
| 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 | |
| 540 | Resource Management |
| 541 | ------------------- |
| 542 | |
| 543 | Delete node |
| 544 | ~~~~~~~~~~~ |
| 545 | |
| 546 | Description |
| 547 | ^^^^^^^^^^^ |
| 548 | |
| 549 | A **delete** node is used to delete a resource from the local resource |
| 550 | inventory. |
| 551 | |
| 552 | Attributes |
| 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 | |
| 563 | Parameters |
| 564 | ^^^^^^^^^^ |
| 565 | |
| 566 | None |
| 567 | |
| 568 | Outcomes |
| 569 | ^^^^^^^^ |
| 570 | |
| 571 | +---------------+--------------------------------------------+ |
| 572 | | **success** | Resource specified deleted successfully. | |
| 573 | +---------------+--------------------------------------------+ |
| 574 | | *failure*> | Resource specified was not deleted | |
| 575 | +---------------+--------------------------------------------+ |
| 576 | |
| 577 | Example |
| 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 | |
| 593 | Exists node |
| 594 | ~~~~~~~~~~~ |
| 595 | |
| 596 | Description |
| 597 | ^^^^^^^^^^^ |
| 598 | |
| 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. |
| 602 | |
| 603 | Attributes |
| 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 | |
| 614 | Parameters |
| 615 | ^^^^^^^^^^ |
| 616 | |
| 617 | None |
| 618 | |
| 619 | Outcomes |
| 620 | ^^^^^^^^ |
| 621 | |
| 622 | +-------------+---------------------------------+ |
| 623 | | **true** | Resource specified exists. | |
| 624 | +-------------+---------------------------------+ |
| 625 | | **false** | Resource specified is unknown | |
| 626 | +-------------+---------------------------------+ |
| 627 | |
| 628 | Example |
| 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 | |
| 644 | Get-resource node |
| 645 | ~~~~~~~~~~~~~~~~~ |
| 646 | |
| 647 | Description |
| 648 | ^^^^^^^^^^^ |
| 649 | |
| 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. |
| 654 | |
| 655 | Attributes |
| 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 | |
| 672 | Parameters |
| 673 | ^^^^^^^^^^ |
| 674 | |
| 675 | None |
| 676 | |
| 677 | Outcomes |
| 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 | |
| 688 | Example |
| 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 | |
| 708 | Is-available node |
| 709 | ~~~~~~~~~~~~~~~~~ |
| 710 | |
| 711 | Description |
| 712 | ^^^^^^^^^^^ |
| 713 | |
| 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. |
| 717 | |
| 718 | Attributes |
| 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 | |
| 731 | Parameters |
| 732 | ^^^^^^^^^^ |
| 733 | |
| 734 | None |
| 735 | |
| 736 | Outcomes |
| 737 | ^^^^^^^^ |
| 738 | |
| 739 | +-------------+---------------------------------------+ |
| 740 | | **true** | Resource requested is available | |
| 741 | +-------------+---------------------------------------+ |
| 742 | | **false** | Resource requested is not available | |
| 743 | +-------------+---------------------------------------+ |
| 744 | |
| 745 | Example |
| 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 | |
| 761 | Notify node |
| 762 | ~~~~~~~~~~~ |
| 763 | |
| 764 | Description |
| 765 | ^^^^^^^^^^^ |
| 766 | |
| 767 | A **notify** node is used to inform an external application (e.g. A&AI) |
| 768 | that a resource was updated. |
| 769 | |
| 770 | Attributes |
| 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 | |
| 781 | Parameters |
| 782 | ^^^^^^^^^^ |
| 783 | |
| 784 | None |
| 785 | |
| 786 | Outcomes |
| 787 | ^^^^^^^^ |
| 788 | |
| 789 | +---------------+----------------------------------------+ |
| 790 | | **success** | Notification was successful | |
| 791 | +---------------+----------------------------------------+ |
| 792 | | **failure** | Notification failed is not available | |
| 793 | +---------------+----------------------------------------+ |
| 794 | |
| 795 | Example |
| 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 | |
| 811 | Release node |
| 812 | ~~~~~~~~~~~~ |
| 813 | |
| 814 | Description |
| 815 | ^^^^^^^^^^^ |
| 816 | |
| 817 | A **release** node is used to mark a resource as no longer in use, and |
| 818 | thus available for assignment. |
| 819 | |
| 820 | Attributes |
| 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 | |
| 831 | Parameters |
| 832 | ^^^^^^^^^^ |
| 833 | |
| 834 | None |
| 835 | |
| 836 | Outcomes |
| 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 | |
| 847 | Example |
| 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 | |
| 866 | Reserve node |
| 867 | ~~~~~~~~~~~~ |
| 868 | |
| 869 | Description |
| 870 | ^^^^^^^^^^^ |
| 871 | |
| 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 |
| 874 | switch. |
| 875 | |
| 876 | Attributes |
| 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 | |
| 889 | Parameters |
| 890 | ^^^^^^^^^^ |
| 891 | |
| 892 | None |
| 893 | |
| 894 | Outcomes |
| 895 | ^^^^^^^^ |
| 896 | |
| 897 | +---------------+----------------------------------------------------+ |
| 898 | | **success** | Resource requested was successfully reserved | |
| 899 | +---------------+----------------------------------------------------+ |
| 900 | | **failure** | Resource requested was not successfully reserved | |
| 901 | +---------------+----------------------------------------------------+ |
| 902 | |
| 903 | Example |
| 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 | |
| 920 | Save node |
| 921 | ~~~~~~~~~ |
| 922 | |
| 923 | Description |
| 924 | ^^^^^^^^^^^ |
| 925 | |
| 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. |
| 929 | |
| 930 | Attributes |
| 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 | |
| 945 | Parameters |
| 946 | ^^^^^^^^^^ |
| 947 | |
| 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 |
| 950 | to set. |
| 951 | |
| 952 | Outcomes |
| 953 | ^^^^^^^^ |
| 954 | |
| 955 | +---------------+-------------------------------+ |
| 956 | | **success** | Resource successfully saved | |
| 957 | +---------------+-------------------------------+ |
| 958 | | **failure** | Resource save failed | |
| 959 | +---------------+-------------------------------+ |
| 960 | |
| 961 | Example |
| 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 | |
| 978 | Update node |
| 979 | ~~~~~~~~~~~ |
| 980 | |
| 981 | Description |
| 982 | ^^^^^^^^^^^ |
| 983 | |
| 984 | An **update** node is used to update information about a particular |
| 985 | resource to persistent storage. |
| 986 | |
| 987 | Attributes |
| 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 | |
| 1000 | Parameters |
| 1001 | ^^^^^^^^^^ |
| 1002 | |
| 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 |
| 1005 | to set. |
| 1006 | |
| 1007 | Outcomes |
| 1008 | ^^^^^^^^ |
| 1009 | |
| 1010 | +---------------+-------------------------------+ |
| 1011 | | **success** | Resource successfully saved | |
| 1012 | +---------------+-------------------------------+ |
| 1013 | | **failure** | Resource save failed | |
| 1014 | +---------------+-------------------------------+ |
| 1015 | |
| 1016 | Example |
| 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> |