Snapshot
Fetch multiple project resources in a single call with project.snapshot(include=[...]).
project.snapshot() retrieves several project resources in one call. Instead of making
separate requests for config, organization, teams, members, nodes, and audit events, you
declare which resources you want in the include list and get a single ProjectSnapshot
back.
Basic usage
from optixlog import SDKClient
from optixlog.management import Management
client = SDKClient(base_url="https://optixlog.leidos.com", api_key="sk-opt-...")
mgmt = Management(client)
project = mgmt.project("proj_grating_7f3a")
snapshot = project.snapshot(
include=["config", "organization", "teams", "members", "workflow_nodes", "audit_events"],
)
print(snapshot.config.name)
print(snapshot.organization.name)
for team in (snapshot.teams or []):
print(team.name, team.member_count)Any resource not listed in include is None on the returned ProjectSnapshot.
Controlling result sizes
Each included collection has its own limit argument. Defaults are all 100.
snapshot = project.snapshot(
include=["config", "teams", "workflow_nodes", "audit_events"],
team_limit=50,
member_limit=100,
node_limit=200,
audit_limit=25,
)Snapshot uses existing collection methods
Internally, snapshot calls the same collection methods you can call directly. teams are
fetched with include=["counts"] so member_count is populated. members are fetched with
include_memberships=True. There is no additional deduplication beyond what get_all_members
provides.
Parameters
Prop
Type
ProjectSnapshot fields
Prop
Type
Partial snapshot
You don't have to include everything. Fetch only what you need:
# Just config and organization
snapshot = project.snapshot(include=["config", "organization"])
print(snapshot.config.name)
print(snapshot.organization.industry)
# snapshot.teams is None — not requestedCombining snapshot with direct queries
Use snapshot for a broad initial read, then follow up with a targeted collection query for
details:
snapshot = project.snapshot(include=["teams"])
first_team = snapshot.teams[0] if snapshot.teams else None
if first_team:
# Fetch full membership list for this team specifically
for m in first_team.memberships.iter(include=["user"]):
print(m.user.name, m.role)