OptixLog Docs
Python SDKManagement API

Management API

Construct Management, access project resources, and understand the shared collection contract used by teams, nodes, memberships, and audit events.

The Management API lets you read and query every resource inside an OptixLog project: configuration, organization, teams, memberships, project members, workflow nodes, node labels, and audit events.

Constructing Management

Pass an SDKClient to Management. Then call .project() or .project_from() to get a ManagementProject scoped to a specific project.

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

client = SDKClient(
    base_url="https://optixlog.leidos.com",
    api_key="sk-opt-your-key-here",
)

mgmt = Management(client)

# By project id string
project = mgmt.project("proj_grating_7f3a")

# Or from a ProjectRef (e.g. returned by SDKClient.project())
ref = client.project("proj_grating_7f3a")
project = mgmt.project_from(ref)

Resources on ManagementProject

Once you have a ManagementProject, all resources are available as attributes:

AttributeTypeWhat it gives you
project.idstrThe project id
project.configProjectConfigResource.get() → ProjectConfig
project.organizationProjectOrganizationResource.get() → Organization
project.teamsTeamCollectionlist, get, iter teams
project.workflow_nodesWorkflowNodeCollectionlist, get, iter nodes; .labels for labels
project.audit_eventsAuditEventCollectionlist, get, iter audit events

Two methods live directly on ManagementProject:

  • project.get_all_members(...) — returns all unique members across all teams.
  • project.snapshot(include=[...]) — fetches multiple resources in one call.

The shared collection contract

All collections (teams, workflow_nodes, workflow_nodes.labels, audit_events, team.memberships) share the same method set. Learn it once, use it everywhere.

list(...) — paginated fetch

Returns a Page[T] with .items, .next_cursor, and .total (when available).

page = project.teams.list(
    category="engineering",
    include=["counts"],
    limit=50,
    cursor=None,         # pass page.next_cursor to fetch the next page
    order_by="name",
    order="asc",
)
for team in page.items:
    print(team.name, team.member_count)

get(id) — strict lookup by id

Raises NotFoundError if the record does not exist.

team = project.teams.get("team-abc123")

get_or_none(id) — nullable lookup by id

Returns None instead of raising when the record is missing.

team = project.teams.get_or_none("team-abc123")
if team is not None:
    print(team.name)

iter(...) — walk all pages automatically

Yields items one at a time, requesting the next page as needed. Accepts the same filter and order kwargs as list, but no limit or cursor.

for team in project.teams.iter(category="engineering"):
    print(team.id, team.name)

count(...) — count matching records

Returns an int. Accepts filter kwargs but not include, limit, cursor, or order_by.

n = project.teams.count(category="engineering")

one(...) — exactly-one lookup by filter

Returns the single matching item. Raises NotFoundError if zero match, MultipleResultsError if more than one match.

team = project.teams.one(name="Photonics Engineering")

first(...) — first match or None

Returns the first matching item, or None if nothing matches.

team = project.teams.first(category="engineering")

Filters, includes, and pagination

All filters are AND — every filter you pass must match. For example:

# name contains "Photonics" AND category == "engineering"
page = project.teams.list(name="Photonics", category="engineering")

The include parameter pulls in related data. Without it, related fields are None. For example, include=["counts"] populates team.member_count.

For full details on pagination cursor-passing and the include patterns available on each collection, see:

Error types

ErrorWhen raised
NotFoundError.get(id) found no record; .one(...) matched zero records
MultipleResultsError.one(...) matched more than one record
AuthenticationErrorInvalid or missing API key
ValidationErrorServer rejected the request data

All errors are subclasses of OptixLogError. See the Error Model.

On this page