Skip to main content

Examples

This page is for the practitioner who wants longer walkthroughs than the task guides.

Documentation tiers​

Use the docs layers for different questions:

  • guides for task-shaped examples you can adapt quickly
  • concepts for the mental model behind the handwritten layer
  • API reference for the exact bound methods and parameters
  • notebooks for broader exploratory flows and longer end-to-end sequences

Notebooks​

Running the notebooks​

Each notebook builds its client with SVIClient.from_env(), which reads SASVI_BASE_URL and one set of credentials: SASVI_USERNAME and SASVI_PASSWORD, SASVI_CLIENT_ID and SASVI_CLIENT_SECRET, or SASVI_ACCESS_TOKEN. TLS verification stays on. For a tenant with a self-signed certificate, set SASVI_VERIFY_SSL to the path of its CA bundle, or to false on a test tenant only. Each notebook loads a .env file from the repository root with python-dotenv when there is one.

Neither python-dotenv nor Jupyter is a dependency of sasvi, so install all three:

pip install sasvi python-dotenv jupyter

Set the variables in your shell, or put them in .env at the repository root (it is git-ignored), then start Jupyter from the examples/ directory.

The notebooks are meant to be run cell by cell. Only search_examples.ipynb is read-only. Every other notebook writes as you go, so run them against a test tenant. They read existing data but change only objects they create, and their last section deletes those objects. A few writes cannot be undone:

  • alerts_examples.ipynb leaves its alert on the tenant, closed, because alerts cannot be deleted.
  • admin_examples.ipynb creates a reference list, which the API can only archive, not delete.
  • custom_endpoints/custom_endpoints_entity_fields.ipynb adds a field to an entity type for good.

If you stop a notebook before its last section, delete what it created in Visual Investigator.

Companion pages​

How to use them​

  • start with Before You Start if you do not yet know your VI values
  • start with Quickstart if you have not connected a client yet
  • use the guides when you want the shortest working snippet for one task
  • use the notebooks when you want end-to-end sequences instead of focused snippets
  • keep the API reference open when you want exact method signatures