Snippet Framework Advanced Topics

Download this manual as a PDF file

This section introduces three capabilities that go beyond standard collection workflows: bulk snippets for APIs that return data for multiple collection objects at once, caching for reducing redundant requests within or across collection cycles, and custom steps for developers who need to write their own Requestors or Processors.

Each topic is covered at a conceptual level with pointers to the developer documentation for full implementation details.

Advanced Topics

This chapter introduces advanced Snippet Framework capabilities that address specific use cases beyond standard single-collection pipelines. These topics are summarized here for reference; full implementation detail is available in the developer-facing documentation.

Bulk Snippets

A bulk snippet is a variant of the standard Snippet Framework pattern designed for use cases where a single request returns data for multiple collection objects simultaneously. For example, an API response that contains a list of devices, each with multiple metrics.

In standard execution, the framework runs one pipeline pass per collection object. In bulk mode, a single Requestor retrieves a batch of data, and the framework distributes values from that batch to the appropriate collection objects in post-processing.

Bulk snippets are particularly useful when making repeated individual requests would be inefficient or would exceed API rate limits.

For more information on implementation details, visit the Developer Documentation site for the full documentation.

Caching

The Snippet Framework supports caching of intermediate data to avoid redundant requests acros collection runs or within a single execution. Caching is useful when:

  • Multiple collection objects depend on the same upstream data (e.g., a device inventory endpoint)
  • A request result is needed across multiple Dynamic Application execution cycles
  • An expensive request produces stable data that does not change between short-interval polls

Caching behavior is configured within snippet arguments and managed by the framework automatically.

Caching behavior within the Snippet Framework is distinct from the caching mechanisms described in the Dynamic Application Development manual, which covers Dynamic Application-level caching for non-snippet collection types.

Custom Steps

The Snippet Framework's pipeline model is extensible. Developers can write custom Requestor and Processor steps using decorators from the "silo_low_code" library:

python
from silo.low_code import register_requestor, register_processor

@register_requestor("my_custom_requestor")
def my_requestor(context, **kwargs):
...

@register_processor("my_custom_processor")
def my_processor(data, context, **kwargs):
...

Custom steps are referenced in snippet arguments by their registered names, exactly like toolkit-provided steps. They can be packaged into ScienceLogic Libraries and distributed through PowerPacks.

For more information on implementation details, visit the Developer Documentation site for the full documentation.

Developer Resources

The Developer Documentation site is a reference site maintained separately from this manual. It covers:

  • The Python library API for the Snippet Framework
  • Collection pipeline internals
  • Step registration patterns and examples
  • The full substitution token reference
  • Bulk snippet implementation
  • Worked examples for CLI, REST, and Prometheus collection

The Developer Documentation site might not always correspond to the current "Low-code Tools" PowerPack version installed in your environment. Verify the library version in your Execution Environment against the documentation version before relying on specific API details.