Project
Object-centric interface for Splunk AO projects. This class provides an intuitive way to work with Splunk AO projects, encapsulating project management operations and providing seamless integration with log stream management. ExamplesCreate a new project locally, then persist
project = Project(name=“My AI Project”).create()Get an existing project
project = Project.get(name=“My AI Project”)List all projects
projects = Project.list()Create a log stream for the project
agent_stream = project.create_agent_stream(name=“Production Logs”)List log streams for the project
log_streams = project.list_agent_streams()Access related resources via properties
for stream in project.agent_streams: print(stream.name) for experiment in project.experiments: print(experiment.name) for dataset in project.datasets: print(dataset.name) for prompt in project.prompts: print(prompt.name)Or use the explicit list methods
datasets = project.list_datasets() prompts = project.list_prompts()Manage collaborators
for collab in project.collaborators: print(f”{collab.email}: {collab.role}“)Add a collaborator
project.add_collaborator(user_id=“user-123”, role=CollaboratorRole.EDITOR)Update a collaborator’s role
project.update_collaborator(user_id=“user-123”, role=CollaboratorRole.VIEWER)Remove a collaborator
project.remove_collaborator(user_id=“user-123”)Delete a project (WARNING: cannot be undone!)
old_project = Project.get(name=“Old Project”) old_project.delete()add_collaborator
user_id: The ID of the user to add as a collaborator.role: The role to assign. One of CollaboratorRole.OWNER, EDITOR, VIEWER, or ANNOTATOR. Defaults to VIEWER.
agent_streams
create_agent_stream.
Examples
project = Project.get(name=“My AI Project”)
for stream in project.agent_streams:
print(stream.name)
collaborators
Filter by role
editors = [c for c in project.collaborators if c.role == CollaboratorRole.EDITOR]Update or remove directly on the collaborator object
collab.update(role=CollaboratorRole.EDITOR) collab.remove()create
create_agent_stream
name(str): The name of the agent stream to create.
datasets
delete
Delete a project
project = Project.get(name=“Old Project”) project.delete() assert project.is_deleted()After deletion, the project no longer exists remotely
The local object is marked as DELETED
print(project.sync_state) # SyncState.DELETEDexperiments
get
id(Optional[str]): The project ID.name(Optional[str]): The project name.
list
Process each project
passlist_agent_streams
starting_token (from
next_starting_token on a prior response) to fetch subsequent pages.
Arguments
limit(Union[Unset, int]): Maximum number of agent streams per page. Defaults to 100.starting_token(Union[Unset, int]): Pagination token. Defaults to 0 (first page).
list_collaborators
list_datasets
Process each dataset
passlist_experiments
Process each experiment
passlist_prompts
Process each prompt
passprompts
refresh
remove_collaborator
user_id: The ID of the user to remove.
save
Create a new project
project = Project(name=“My Project”) project.save()Update an existing project’s name via dirty-tracking
project = Project.get(name=“My Project”) project.name = “Renamed Project” # automatically marks DIRTY project.save()update_collaborator
user_id: The ID of the user whose role to update.role: The new role to assign. One of CollaboratorRole.OWNER, EDITOR, VIEWER, or ANNOTATOR.