OptixLog Docs
API ReferenceManagement

Snapshot API

ManagementProject.snapshot — fetch config, organization, teams, members, workflow nodes, and audit events in a single coordinated call.

ManagementProject.snapshot() fetches multiple resources in a single method call and returns a ProjectSnapshot. Use it when you need several resources together — for example, to build a project report or export — without making separate calls for each.

Implementation note

snapshot() is a client-side convenience method. Internally it calls the appropriate collection methods for each requested resource and assembles the results into a ProjectSnapshot. It does not issue a single aggregated server request; each included resource triggers its own network call.


The ProjectSnapshot object

ProjectSnapshot is a frozen dataclass. Every field is None when the corresponding key was not in include:

Prop

Type


ManagementProject.snapshot(...)

Fetch a multi-resource project snapshot.

Signature

def snapshot(
    self,
    *,
    include: Sequence[
        Literal[
            "config",
            "organization",
            "teams",
            "members",
            "workflow_nodes",
            "audit_events",
        ]
    ],
    team_limit: int = 100,
    member_limit: int = 100,
    node_limit: int = 100,
    audit_limit: int = 100,
) -> ProjectSnapshot: ...

Parameters

Prop

Type

Returns — ProjectSnapshot: a frozen dataclass whose fields are populated according to include. Fields not in include are None.

Side effects — Makes one HTTP read request per resource included:

  • "config" → one call to ProjectConfigResource.get()
  • "organization" → one call to ProjectOrganizationResource.get()
  • "teams" → one call to TeamCollection.list(limit=team_limit, include=("counts",))
  • "members" → one call to ManagementProject.get_all_members(include_memberships=True, limit=member_limit)
  • "workflow_nodes" → one call to WorkflowNodeCollection.list(limit=node_limit)
  • "audit_events" → one call to AuditEventCollection.list(limit=audit_limit)

Raises — NotFoundError if "config" or "organization" is in include and the resource does not exist. AuthenticationError when the API key is invalid or missing.

Example

snapshot_report.py
from optixlog import SDKClient
from optixlog.management import Management

client = SDKClient(base_url="https://optixlog.leidos.com", api_key="sk-opt-...")
proj = Management(client).project("proj_grating_7f3a")

snap = proj.snapshot(
    include=["config", "organization", "teams", "members", "workflow_nodes", "audit_events"],
    team_limit=50,
    member_limit=200,
    node_limit=500,
    audit_limit=200,
)

print("Project:", snap.config.name if snap.config else "—")
print("Org:    ", snap.organization.name if snap.organization else "—")
print("Teams:  ", len(snap.teams or []))
print("Members:", len(snap.members or []))
print("Nodes:  ", len(snap.workflow_nodes or []))
print("Events: ", len(snap.audit_events or []))

Selective snapshot

Pass only the keys you need to avoid unnecessary network calls:

selective_snapshot.py
# Only fetch config and the most recent audit events
snap = proj.snapshot(include=["config", "audit_events"], audit_limit=25)

if snap.config:
    print(f"Project '{snap.config.name}' — status: {snap.config.status}")

for event in (snap.audit_events or []):
    print(event.timestamp.isoformat(), event.level, event.action)

Limits and pagination

Each *_limit parameter controls the maximum number of items in that list. The snapshot fetches exactly one page per resource — it does NOT paginate. If you need more items than the limit, use the corresponding collection method directly:

# All nodes, not just the first 100
all_nodes = list(proj.workflow_nodes.iter())

On this page