Atlas project development

Snipe-IT Asset Ops Automation

Provide a reliable CLI layer for Snipe-IT so asset operations can be scripted, audited, and repeated across imports and cleanups. Load a TOML config with API base URL and token. Accept JSON or CSV inputs for bulk create/update/patch operations. Call the Snipe-IT API for assets, users, locations, and related resources. Export API responses to CSV for reporting or follow-on workflows.

Type
Field Tool
Lifecycle
Active
Last touched
2025-12-06
Visibility
Public
Why it's showcased

Demonstrates reliable, repeatable asset operations via a CLI layer, bulk inputs, and exportable audit artifacts.

Purpose

Provide a reliable CLI layer for Snipe-IT so asset operations can be scripted, audited, and repeated across imports and cleanups.

Current state

Last touched: 2025-12-06. Functionality and completeness: Core CLI resource coverage is present; operational runbooks are still maturing.

Next step

Add baseline automated tests to cover critical flows; Add CI pipeline for build/test/lint; Document deployment/runtime environment (or add Dockerfile); Document interfaces (CLI flags, API endpoints, file formats); Add structured logging and basic health checks.

Interfaces

Inputs
  • Snipe-IT API credentials, CSV/JSON inputs, asset records
Outputs
  • CSV exports, API updates, operational reports

Reality to Action trace

Reality Ingestion

Contributes in this stage.

Canonical Storage

Not in scope.

Automation Engines

Not in scope.

Human Interfaces

Contributes in this stage.

Operational Adoption

Contributes in this stage.

Core workflow

  1. Load CLI config with API base URL and token.
  2. Read CSV/JSON input files for the intended operation.
  3. Validate required fields and IDs.
  4. Query Snipe-IT for current state when needed.
  5. Apply create/update/patch/delete via API.
  6. Export API responses to CSV for review.
  7. Record logs and error summaries.

Data integrity and contracts

Canonical schema definitions

  • CSV templates for assets, users, locations, and assignments.
  • JSON payload schema for bulk operations.
  • TOML config schema for API connection settings.
  • Export CSV column layout for audit artifacts.

Source of truth rules

  • Input CSV/JSON defines the desired state for targeted records.
  • Snipe-IT is updated to match input during runs.
  • The CLI does not infer missing values; explicit inputs are authoritative.

Data quality checks

  • Validate required fields (asset tag, serial, user ID).
  • Verify referenced IDs exist (models, categories, locations).
  • Preflight API connectivity before writes.
  • Emit exception reports for failed records.

Safe handling

  • Keep API tokens out of git and protect config files.
  • Treat CSV inputs and exports as sensitive inventory data.
  • Use least-privilege API tokens and rotate regularly.

Downstream integration map

  • Inventory accuracy reporting.
  • Device refresh planning.
  • Operational audit trails.

Operational notes

Reliability posture

Failure modes and safe behavior: API errors are surfaced in CLI output; CSV import errors fail the run. Idempotency / retries / batching behavior: No built-in retries; re-running CSV imports can reapply changes.

Observability

  • Logs: tracing-based logs and CLI status output
  • Metrics/health checks: None documented
  • stdout/stderr for CLI status

Security and privacy

Config files contain API tokens; keep them out of version control and restrict file permissions.

Dependencies

Upstream
  • Snipe-IT API
  • Snipe-IT data quality
Downstream
  • refresh planning
  • inventory accuracy

Ownership

Owners

Josh Barton

Users

you, IT ops, Josh Barton (owner)

snipeit_api

Architecture & Major Components

  • High-level diagram (text):

    • CLI -> resource module -> API client -> CSV/JSON IO -> reports
  • Entry points: src/main.rs

  • Top-level folders: src, Old Version

  • Key abstractions: resource modules per API domain, CSV import/export utilities, tracing-based logging

Setup / Build / Run

  • Build system(s): Cargo.
  • Provide a TOML config with API base URL and token, then run the CLI for desired resources.