Services API¶
The services package provides high-level Python interfaces for XNAT REST API operations. Each service class encapsulates operations for a specific resource type (projects, subjects, sessions, etc.).
Service Layer Architecture¶
Design Pattern:
All services follow the service layer pattern:
Instantiate with authenticated client
Call service methods (list, get, create, update, delete)
Receive typed model objects (not raw JSON)
Benefits:
Type-safe operations with Pydantic models
Automatic retry and error handling
Consistent pagination and filtering
Clean separation of concerns
Common Usage Pattern:
from xnatctl.core.client import XNATClient
from xnatctl.services.projects import ProjectService
# Create and authenticate client
client = XNATClient(
base_url="https://xnat.example.org",
username="admin",
password="secret"
)
client.authenticate()
# Instantiate service
service = ProjectService(client)
# Call service methods
projects = service.list()
project = service.get("MYPROJECT")
Base Service¶
Foundation class providing common HTTP method wrappers and pagination utilities.
Projects Service¶
Manage XNAT projects: list, inspect, create, and configure.
Hierarchy:
Project (top-level)
└── Subject
└── Session
└── Scan
└── Resource
Common Operations:
from xnatctl.services.projects import ProjectService
service = ProjectService(client)
# List all accessible projects
projects = service.list()
# Get specific project details
project = service.get("MYPROJECT")
print(f"Name: {project.name}")
print(f"PI: {project.pi}")
print(f"Subjects: {project.subject_count}")
# Create new project
new_project = service.create(
project_id="NEWPROJECT",
name="New Project",
pi_firstname="Jane",
pi_lastname="Smith",
accessibility="private"
)
- class xnatctl.services.projects.ProjectService(client)[source]¶
Bases:
BaseServiceService for XNAT project operations.
- get(project_id)[source]¶
Get project details.
- Parameters:
project_id (str) – Project ID
- Returns:
Project object
- Raises:
ResourceNotFoundError – If project not found
- Return type:
- create(project_id, name=None, description=None, keywords=None, pi_firstname=None, pi_lastname=None, accessibility='private')[source]¶
Create a new project.
- Parameters:
project_id (str) – Project ID (must be unique)
name (str | None) – Project name (defaults to project_id)
description (str | None) – Project description
keywords (str | None) – Comma-separated keywords
pi_firstname (str | None) – PI first name
pi_lastname (str | None) – PI last name
accessibility (str) – Access level (private, protected, public)
- Returns:
Created Project object
- Return type:
Subjects Service¶
Manage subjects (participants) within projects.
Subject Lifecycle:
Create subject in a project
Add imaging sessions to subject
Optionally rename or delete subject
Common Operations:
from xnatctl.services.subjects import SubjectService
service = SubjectService(client)
# List subjects in a project
subjects = service.list(project="MYPROJECT")
# Get specific subject
subject = service.get(
project="MYPROJECT",
subject="SUB001"
)
# Rename subject
service.rename(
project="MYPROJECT",
subject="SUB001",
new_label="PARTICIPANT001"
)
# Delete subject (WARNING: destructive)
service.delete(
project="MYPROJECT",
subject="SUB001"
)
- class xnatctl.services.subjects.SubjectService(client)[source]¶
Bases:
BaseServiceService for XNAT subject operations.
- get(subject_id, project=None)[source]¶
Get subject details.
- Parameters:
- Returns:
Subject object
- Raises:
ResourceNotFoundError – If subject not found
- Return type:
- delete(subject_id, project=None, remove_files=False, force=False)[source]¶
Delete a subject.
By default, refuses to delete a subject that still has experiments attached (XNAT would cascade-delete the experiments). Pass
force=Trueto override this safety check — but only do so after explicitly reassigning or archiving the experiments yourself.- Parameters:
- Returns:
True if successful.
- Raises:
RuntimeError – If the subject has attached experiments and
force=False.- Return type:
- rename_pattern(project, match_pattern, to_template, dry_run=False, merge=False)[source]¶
Rename subjects matching a pattern.
- Parameters:
- Returns:
Summary dict with renamed, merged, skipped, errors
- Return type:
- merge_subjects(project, source_label, target_label, dry_run=False)[source]¶
Merge source subject into target subject.
This moves all experiments/sessions from the source subject to the target subject, then deletes the empty source subject.
Use this when renaming would result in a duplicate - the experiments are consolidated under the target subject.
- Parameters:
- Returns:
experiments_moved: number of experiments moved
source_deleted: whether source was deleted
experiments: list of moved experiment IDs
- Return type:
Summary dict with
- Raises:
ResourceNotFoundError – If source or target not found
Sessions Service¶
Manage imaging sessions (experiments) containing scan data.
Session Types:
Sessions represent data collection events. Common types include:
Baseline scans
Follow-up visits
Longitudinal timepoints
Multi-modal acquisitions
Filtering by Modality:
from xnatctl.services.sessions import SessionService
service = SessionService(client)
# List all MR sessions in a project
mr_sessions = service.list(
project="MYPROJECT",
modality="MR"
)
# List sessions for a specific subject
subject_sessions = service.list(
project="MYPROJECT",
subject="SUB001"
)
# Get session details
session = service.get(
session_id="XNAT_E00001",
project="MYPROJECT"
)
print(f"Date: {session.session_date}")
print(f"Scans: {session.scan_count}")
print(f"Scanner: {session.scanner}")
- class xnatctl.services.sessions.SessionService(client)[source]¶
Bases:
BaseServiceService for XNAT session/experiment operations.
- list(project=None, subject=None, modality=None, limit=None, columns=None)[source]¶
List sessions/experiments.
- Parameters:
- Returns:
List of Session objects
- Return type:
- get(session_id, project=None)[source]¶
Get session details.
- Parameters:
- Returns:
Session object
- Raises:
ResourceNotFoundError – If session not found
- Return type:
- create(project, subject, label, xsi_type='xnat:mrSessionData', date=None, time=None, visit_id=None, modality=None)[source]¶
Create a new session/experiment.
- Parameters:
project (str) – Project ID
subject (str) – Subject ID or label
label (str) – Session label
xsi_type (str) – XSI type (xnat:mrSessionData, xnat:petSessionData, etc)
date (str | None) – Session date (YYYY-MM-DD)
time (str | None) – Session time (HH:MM:SS)
visit_id (str | None) – Visit identifier
modality (str | None) – Modality (overrides xsi_type if provided)
- Returns:
Created Session object
- Return type:
Scans Service¶
Manage individual imaging scans (series) within sessions.
Scan Operations:
from xnatctl.services.scans import ScanService
service = ScanService(client)
# List scans in a session
scans = service.list(
project="MYPROJECT",
session="SESSION01"
)
for scan in scans:
print(f"{scan.scan_id}: {scan.type}")
print(f" Quality: {scan.quality}")
print(f" Files: {scan.file_count}")
# Delete a scan
service.delete(
project="MYPROJECT",
session="SESSION01",
scan="1"
)
- class xnatctl.services.scans.ScanService(client)[source]¶
Bases:
BaseServiceService for XNAT scan operations.
- get(session_id, scan_id, project=None)[source]¶
Get scan details.
- Parameters:
- Returns:
Scan object
- Raises:
ResourceNotFoundError – If scan not found
- Return type:
- delete_multiple(session_id, scan_ids, project=None, remove_files=False, parallel=True, workers=4, progress_callback=None)[source]¶
Delete multiple scans.
- Parameters:
session_id (str) – Session ID
scan_ids (list[str]) – List of scan IDs to delete (“*” for all)
project (str | None) – Project ID
remove_files (bool) – Also remove files
parallel (bool) – Use parallel deletion
workers (int) – Number of parallel workers
progress_callback (Callable[[int, int, str], None] | None) – Callback(current, total, scan_id)
- Returns:
Summary dict with deleted, failed, errors
- Return type:
Resources Service¶
Manage file resources attached to XNAT objects.
Resource Types:
Common resource categories:
DICOM- Raw DICOM filesNIFTI- Converted NIfTI volumesSNAPSHOTS- Preview imagesQC- Quality control reportsPROCESSED- Analysis outputs
Upload and Download:
from xnatctl.services.resources import ResourceService
service = ResourceService(client)
# List resources
resources = service.list(
project="MYPROJECT",
session="SESSION01"
)
# Upload files to a resource
service.upload(
project="MYPROJECT",
session="SESSION01",
resource="PROCESSED",
files=["analysis.nii.gz", "report.pdf"]
)
# Download resource
service.download(
project="MYPROJECT",
session="SESSION01",
resource="DICOM",
dest="./downloads/"
)
- class xnatctl.services.resources.ResourceService(client)[source]¶
Bases:
BaseServiceService for XNAT resource operations.
- list_files(session_id, resource_label, scan_id=None, project=None)[source]¶
List files in a resource.
- create(session_id, resource_label, scan_id=None, project=None, format=None, content=None)[source]¶
Create a new resource.
- Parameters:
- Returns:
Created Resource object
- Return type:
- delete(session_id, resource_label, scan_id=None, project=None, remove_files=True)[source]¶
Delete a resource.
- upload_file(session_id, resource_label, file_path, scan_id=None, project=None, extract=False, overwrite=False)[source]¶
Upload a file to a resource.
- Parameters:
- Returns:
Upload result dict
- Return type:
Downloads Service¶
High-performance parallel download operations with resume support.
Features:
Multi-threaded parallel downloads
Resume support for interrupted transfers
Progress tracking with Rich progress bars
Automatic retry on transient failures
Checksum verification
Parallel Download Example:
from xnatctl.services.downloads import DownloadService
service = DownloadService(client)
# Download with 8 parallel workers
service.download_session(
project="MYPROJECT",
session="SESSION01",
dest="./data/",
workers=8,
show_progress=True
)
Download service for XNAT download operations.
- class xnatctl.services.downloads.DownloadService(client)[source]¶
Service for XNAT download operations.
- download_session(session_id, output_dir, project=None, include_resources=True, include_assessors=False, pattern=None, resume=False, verify=False, parallel=True, workers=4, progress_callback=None)[source]¶
Download session data.
- Parameters:
session_id (str) – Session ID
output_dir (Path) – Output directory path
project (str | None) – Project ID
include_resources (bool) – Include session-level resources
include_assessors (bool) – Include assessor data
pattern (str | None) – File pattern filter
resume (bool) – Resume interrupted download
verify (bool) – Verify checksums after download
parallel (bool) – Use parallel downloads
workers (int) – Number of parallel workers
progress_callback (Callable[[DownloadProgress], None] | None) – Progress callback function
- Returns:
DownloadSummary with results
- Return type:
- download_resource(session_id, resource_label, output_dir, scan_id=None, project=None, extract=False, zip_filename=None, progress_callback=None)[source]¶
Download a specific resource.
- Parameters:
session_id (str) – Session ID
resource_label (str) – Resource label
output_dir (Path) – Output directory
scan_id (str | None) – Scan ID (for scan-level resources)
project (str | None) – Project ID
extract (bool) – Extract ZIP files (default: False)
zip_filename (str | None) – Custom ZIP filename (default: {resource_label}.zip)
progress_callback (Callable[[DownloadProgress], None] | None) – Progress callback
- Returns:
DownloadSummary with results
- Return type:
- download_scan(session_id, scan_id, output_dir, project=None, resource=None, progress_callback=None)[source]¶
Download a specific scan.
- Parameters:
- Returns:
DownloadSummary with results
- Return type:
- download_scans(session_id, scan_ids, output_dir, project=None, subject=None, resource=None, zip_filename=None, extract=False, cleanup=True, progress_callback=None)[source]¶
Download multiple scans in a single request.
Uses XNAT’s comma-separated scan ID feature for efficient batch downloads. When resource is None, downloads ALL files (DICOM + SNAPSHOTS).
- Parameters:
session_id (str) – Session ID or label
scan_ids (list[str]) – List of scan IDs (or [“ALL”] for all scans)
output_dir (Path) – Output directory
project (str | None) – Project ID (required when using session label)
subject (str | None) – Subject ID/label (optional, narrows experiment lookup)
resource (str | None) – Resource type (None = all resources, “DICOM” = DICOM only)
zip_filename (str | None) – Output ZIP filename (default: scans.zip)
extract (bool) – Extract ZIP after download
cleanup (bool) – Remove ZIP after successful extraction (with extract=True)
progress_callback (Callable[[DownloadProgress], None] | None) – Progress callback
- Returns:
DownloadSummary with results
- Return type:
Uploads Service¶
High-performance parallel upload operations for DICOM and file resources.
Upload Strategies:
xnatctl supports two DICOM upload strategies:
Gradual DICOM (default): REST API upload with parallel workers
Prearchive: Upload to staging area for review before archiving
Features:
Multi-threaded parallel uploads
Automatic retry with exponential backoff
Progress tracking
Sequential fallback for failed files
Thread-local HTTP clients for stability
Parallel Upload Example:
from xnatctl.services.uploads import UploadService
service = UploadService(client)
# Upload DICOM files with 8 workers
service.upload_dicom(
project="MYPROJECT",
subject="SUB001",
session="SESSION01",
files=["scan001.dcm", "scan002.dcm", ...],
workers=8,
show_progress=True
)
Error Handling:
Failed uploads are automatically retried at lower concurrency, with a final sequential retry pass to maximize completion rate on flaky networks.
Upload service for XNAT upload operations.
Provides UploadService with methods for all upload transports: - REST batch upload (simple ZIP batches via import service) - Parallel REST upload (batched archives with parallel workers) - DICOM C-STORE upload (pynetdicom-based network transfer) - Resource upload (file/directory upload to session resources)
Public utility functions (collect_dicom_files, split_into_batches, etc.) are available for direct import and testing.
- class xnatctl.services.uploads.DICOMStoreSummary(total_files, sent, failed, log_dir, workspace, success)[source]¶
Summary of a DICOM C-STORE operation.
- xnatctl.services.uploads.collect_dicom_files(root, *, include_extensionless=True)[source]¶
Recursively collect DICOM-like files under a root directory.
- Parameters:
- Returns:
Sorted list of file paths.
- Raises:
ValueError – If root is not a directory.
- Return type:
- xnatctl.services.uploads.archive_destination_params(project, direct_archive)[source]¶
Return the querystring keys that route a POST /data/services/import.
Direct-archive path:
Direct-Archive=true— handled by theDICOM-zipandgradual-DICOMimport handlers; bypasses the prearchive and writes straight to the project archive.Prearchive path:
dest=/prearchive/projects/{project}— the documented destination form.Direct-Archive=falsealone is equivalent to “use standard upload mechanism”; we prefer the explicitdestbecause it is self-describing and matches thePrearchiveServicepattern used elsewhere in this repo.
Caveat: neither form can prevent a project-configured auto-archive. XNAT’s
prearchive_codeon the project (0=manual, 4/5=auto) is the authoritative switch. When a project has auto-archive enabled, a session uploaded via either of these paths will land in prearchive momentarily then be auto-archived by the server. To force prearchive-only behaviour, the project’s prearchive setting must be changed to “Leave in prearchive” (prearchive_code=0). There is no per-upload import-service override for this on XNAT 1.8+.
- xnatctl.services.uploads.split_into_batches(files, batch_size)[source]¶
Split files into batches of specified size.
- xnatctl.services.uploads.split_into_n_batches(files, num_batches)[source]¶
Split files into N roughly equal batches using round-robin.
- xnatctl.services.uploads.is_retryable_status(status_code)[source]¶
Check if an HTTP status code warrants a retry.
Retryable: 400 (XNAT transient), 429 (rate limit), 5xx (server errors). Non-retryable: 2xx (success), 401/403 (auth), other 4xx (client error).
- xnatctl.services.uploads.upload_with_retry(upload_fn, *, max_retries=5, backoff_base=2, label='upload')[source]¶
Execute an upload function with retry on transient HTTP errors.
- Parameters:
upload_fn (Callable[[], Response]) – Callable that performs the upload and returns an httpx.Response. Will be called multiple times on retry – must be idempotent.
max_retries (int) – Maximum number of retries (default: 5).
backoff_base (int) – Base for exponential backoff in seconds (default: 2).
label (str) – Label for log messages.
- Returns:
The httpx.Response from a successful attempt.
- Raises:
The last exception if all retries are exhausted and no response was obtained. –
- Return type:
Response
- class xnatctl.services.uploads.UploadService(client)[source]¶
Service for XNAT upload operations.
Provides methods for all upload transports: REST batch, parallel REST, DICOM C-STORE, and resource uploads.
- upload_dicom(project, subject, session, source_path, overwrite=False, quarantine=False, batch_size=500, parallel=True, workers=4, progress_callback=None)[source]¶
Upload DICOM files via simple REST batch (ZIP per batch).
- Parameters:
project (str) – Project ID.
subject (str) – Subject label.
session (str) – Session label.
source_path (Path) – Path to DICOM files (directory or ZIP).
overwrite (bool) – Overwrite existing scans.
quarantine (bool) – Send to prearchive instead.
batch_size (int) – Files per upload batch.
parallel (bool) – Use parallel uploads.
workers (int) – Number of parallel workers.
progress_callback (Callable[[UploadProgress], None] | None) – Progress callback function.
- Returns:
UploadSummary with results.
- Return type:
- upload_dicom_parallel(source_dir, project, subject, session, *, username=None, password=None, upload_workers=4, archive_workers=4, archive_format='tar', import_handler='DICOM-zip', ignore_unparsable=True, overwrite='delete', direct_archive=True, timeout=21600, progress_callback=None)[source]¶
Upload DICOM files using parallel batched archives via REST import.
High-throughput upload that: 1. Collects DICOM files from the source directory 2. Splits files into N batches (N = upload_workers) 3. Creates archives in parallel 4. Uploads archives in parallel with per-thread HTTP clients
- Parameters:
source_dir (Path) – Directory containing DICOM files.
project (str) – Target project ID.
subject (str) – Target subject label.
session (str) – Target session label.
username (str | None) – XNAT username (override for per-thread auth).
password (str | None) – XNAT password (override for per-thread auth).
upload_workers (int) – Parallel upload workers (default: 4).
archive_workers (int) – Parallel archive workers (default: 4).
archive_format (str) – Archive format, “tar” or “zip” (default: tar).
import_handler (str) – XNAT import handler (default: DICOM-zip).
ignore_unparsable (bool) – Skip unparsable DICOM files (default: True).
overwrite (str) – Overwrite mode: none, append, delete (default: delete).
direct_archive (bool) – Use direct archive vs prearchive (default: True).
timeout (int) – HTTP timeout in seconds.
progress_callback (Callable[[UploadProgress], None] | None) – Optional callback for progress updates.
- Returns:
UploadSummary with results.
- Return type:
- upload_dicom_store(dicom_root, host, called_aet, *, port=104, calling_aet='XNATCTL', workers=4, cleanup=True)[source]¶
Send DICOM files to an SCP using C-STORE.
This method: 1. Verifies connectivity with C-ECHO 2. Collects DICOM files from the root directory 3. Splits files into batches for parallel associations 4. Sends files using multiple concurrent C-STORE associations
- Parameters:
dicom_root (Path) – Directory containing DICOM files.
host (str) – DICOM SCP host.
called_aet (str) – Remote AE title.
port (int) – DICOM SCP port (default: 104).
calling_aet (str) – Our AE title (default: XNATCTL).
workers (int) – Number of parallel associations (default: 4).
cleanup (bool) – Remove temporary workspace on completion (default: True).
- Returns:
DICOMStoreSummary with results.
- Raises:
ImportError – If pydicom/pynetdicom are not installed.
ValueError – If dicom_root is not a directory.
RuntimeError – If C-ECHO fails or no DICOM files found.
- Return type:
- upload_dicom_gradual(source_path, project, subject, session, *, workers=4, direct_archive=True, progress_callback=None)[source]¶
Upload DICOM files using the gradual-DICOM handler (parallel per-file).
Each file is uploaded individually to the XNAT import service using the gradual-DICOM handler, which lets XNAT parse each file on ingest. Files are uploaded in parallel using per-thread HTTP clients.
Accepts directories or ZIP archives. ZIP archives are extracted to a temporary directory before upload. Only DICOM-like files are sent: known DICOM extensions plus extensionless files commonly produced by scanners.
- Parameters:
source_path (Path) – Directory or ZIP file containing DICOM files.
project (str) – Target project ID.
subject (str) – Target subject label.
session (str) – Target session label.
workers (int) – Number of parallel upload workers (default: 4).
direct_archive (bool) – Use direct archive vs prearchive (default: True).
progress_callback (Callable[[UploadProgress], None] | None) – Optional callback for progress updates.
- Returns:
UploadSummary with results.
- Raises:
ValueError – If source_path is not a directory or ZIP file.
FileNotFoundError – If source_path does not exist.
- Return type:
- upload_dicom_gradual_files(*, files, project, subject, session, workers=4, direct_archive=True, progress_callback=None)[source]¶
Upload a specific list of DICOM files via the gradual-DICOM handler.
Unlike
upload_dicom_gradual(), this method uploads only the files explicitly provided and does not scan any directories.- Parameters:
project (str) – Target project ID.
subject (str) – Target subject label.
session (str) – Target session label.
direct_archive (bool) – Use direct archive vs prearchive (default: True).
workers (int) – Number of parallel upload workers.
progress_callback (Callable[[UploadProgress], None] | None) – Optional callback for progress updates.
- Returns:
UploadSummary with results.
- Raises:
FileNotFoundError – If any provided path does not exist.
ValueError – If any provided path is not a file.
- Return type:
- upload_resource(session_id, resource_label, source_path, scan_id=None, project=None, extract=False, overwrite=False, progress_callback=None)[source]¶
Upload files to a resource.
- Parameters:
session_id (str) – Session ID.
resource_label (str) – Resource label.
source_path (Path) – File or directory to upload.
scan_id (str | None) – Scan ID (for scan-level resources).
project (str | None) – Project ID.
extract (bool) – Extract ZIP/TAR after upload.
overwrite (bool) – Overwrite existing files.
progress_callback (Callable[[UploadProgress], None] | None) – Progress callback.
- Returns:
UploadSummary with results.
- Return type:
Prearchive Service¶
Manage the XNAT prearchive staging area for reviewing uploads before archiving.
Prearchive Workflow:
Upload DICOM files to prearchive
Review session metadata and quality
Archive to final location or delete
Operations:
from xnatctl.services.prearchive import PrearchiveService
service = PrearchiveService(client)
# List prearchive sessions
sessions = service.list(project="MYPROJECT")
for session in sessions:
print(f"{session.name} - {session.status}")
print(f" Uploaded: {session.upload_date}")
print(f" Scans: {session.scan_count}")
# Archive session from prearchive
service.archive(
project="MYPROJECT",
timestamp="20240101_120000",
session="SESSION01"
)
# Delete prearchive session
service.delete(
project="MYPROJECT",
timestamp="20240101_120000",
session="SESSION01"
)
- class xnatctl.services.prearchive.PrearchiveService(client)[source]¶
Bases:
BaseServiceService for XNAT prearchive operations.
- archive(project, timestamp, session_name, subject=None, experiment_label=None, overwrite=False)[source]¶
Archive a session from prearchive.
- Parameters:
- Returns:
Result dict with archived session info
- Return type:
Pipelines Service¶
Execute and monitor XNAT processing pipelines.
Pipeline Operations:
from xnatctl.services.pipelines import PipelineService
service = PipelineService(client)
# List available pipelines
pipelines = service.list(project="MYPROJECT")
# Run pipeline on a session
run_id = service.run(
project="MYPROJECT",
session="SESSION01",
pipeline="DicomToNifti"
)
# Check pipeline status
status = service.status(
project="MYPROJECT",
run_id=run_id
)
print(f"Status: {status}")
- class xnatctl.services.pipelines.PipelineService(client)[source]¶
Bases:
BaseServiceService for XNAT pipeline operations.
- run(pipeline_name, experiment_id, project=None, params=None)[source]¶
Run a pipeline on an experiment.
- wait(job_id, timeout=3600, poll_interval=30, progress_callback=None)[source]¶
Wait for a pipeline job to complete.
- Parameters:
- Returns:
Final job status dict
- Raises:
OperationError – If job fails or times out
- Return type:
Admin Service¶
Administrative operations including catalog refresh, user management, and audit logs.
Admin Operations:
from xnatctl.services.admin import AdminService
service = AdminService(client)
# Refresh project catalogs
service.refresh_catalogs(project="MYPROJECT")
# List users
users = service.list_users()
# View audit logs
logs = service.audit_logs(
project="MYPROJECT",
limit=100
)
- class xnatctl.services.admin.AdminService(client)[source]¶
Bases:
BaseServiceService for XNAT administrative operations.
- refresh_catalogs(project, experiments=None, options=None, limit=None, parallel=True, workers=4, progress_callback=None)[source]¶
Refresh catalog XMLs for project experiments.
- Parameters:
project (str) – Project ID
experiments (list[str] | None) – Specific experiment IDs (or all if None)
options (list[str] | None) – Refresh options (checksum, delete, append, populateStats)
limit (int | None) – Limit number of experiments
parallel (bool) – Use parallel execution
workers (int) – Number of parallel workers
progress_callback (Callable[[int, int, str], None] | None) – Callback(current, total, experiment_id)
- Returns:
Summary dict with refreshed, failed, errors
- Return type:
- add_user_to_groups(username, groups, projects=None, role='member')[source]¶
Add a user to XNAT groups.
- audit_log(project=None, username=None, action=None, since=None, limit=100)[source]¶
Get audit log entries.