Skip to content

refactor: use deployment command names - #51

Merged
JacobPEvans-personal merged 63 commits into
mainfrom
refactor/deployment-command-names
Jul 31, 2026
Merged

refactor: use deployment command names#51
JacobPEvans-personal merged 63 commits into
mainfrom
refactor/deployment-command-names

Conversation

@JacobPEvans-personal

Copy link
Copy Markdown
Contributor

Summary

  • replace the generic deploy command area with deploy-server and deploy-client
  • retain the existing deployment-server REST contracts and write gate
  • update canonical command catalog and command contract coverage

Validation

  • PYTHONPATH=src .venv/bin/pytest tests/unit/test_app_deploy_contracts.py tests/unit/test_commands.py
  • .venv/bin/ruff check …
  • .venv/bin/ruff format --check …
  • .venv/bin/pyright
  • git diff --check

Adds checks beyond reachability/splunkd, each independent (one failing check
cannot crash the rest):
- resource usage (CPU, memory) from
  /services/server/status/resource-usage/hostwide
- per-partition disk space from /services/server/status/partitions-space
- a clean-room internal-error-rate check over _internal (original SPL, not the
  proprietary Monitoring Console searches)

Thresholds are named constants (calibration knobs). Checks carry a version
(HEALTH_CHECKS_VERSION) so they can evolve as data.

Closes #11
- The client now supports `Authorization: Splunk <sessionKey>` alongside Bearer
  tokens. config_from_env: SPLUNK_TOKEN -> Bearer (unchanged); else
  SPLUNK_SESSION_KEY -> the Splunk scheme.
- `splunk auth login` mints a session key via /services/auth/login (username +
  password from env or a no-echo prompt, never a flag) and prints it; `auth status`
  reports the active scheme and target without revealing the secret.
- Config-file profiles (stdlib INI): `--profile` / SPLUNK_PROFILE selects a
  [section] supplying url / token / session_key / app / owner. Precedence is
  flag > env > profile > default, applied per value. With no config file there is
  no change -- fully backward compatible.

Closes #13
Add a 'kvstore' command group over a collection's data records --
records/get/insert/update/delete/purge -- treating KV Store data as a
plain JSON document store under /servicesNS/<owner>/<app>/storage/
collections/data/<collection>. This is distinct from the collection
*schema*, which stays in the 'kvstore-collection' factory group.

Reads default to the '-' namespace wildcard; writes require an explicit
app (never the default 'search') and route through do_write for the
dry-run/confirm/audit gate. Reuses the client's get_json/write_json so
JSON bodies and array responses bypass the Splunk entry[].content
envelope.

Closes #9
…restart and settings (#10)

Add platform-level inspect and control:
- 'cluster status' / 'shcluster status' summarize indexer- and
  search-head-cluster health (reads).
- 'license list|get|usage' report licenses and pool usage (reads).
- 'server restart' triggers a gated restart via /server/control/restart.
- 'server settings get|set' read and (gated) change system settings;
  'set' takes repeatable --set KEY=VALUE and sends only changed keys.

These are system-level resources (not namespaced). Every mutation routes
through do_write for the dry-run/confirm/--yes/audit gate; restart and
settings-set never fire without explicit confirmation. 'message' already
ships via the registry/factory and is left unchanged.

Closes #10
Add the two parts of app/deploy that the CRUD specs cannot cover:
- 'app install --file PATH | --url URL [--update]' installs an app via
  /services/apps/appinstall (Splunk reads a local path server-side or
  fetches an http(s) URL); exactly one source is required.
- 'deploy' group: 'client list', 'serverclass list|get|create|update',
  and 'reload' for the deployment server.

App lifecycle (list/get/enable/disable/remove) keeps shipping via the
registry/factory; this adds only the hand-written multipart-ish install
and the deployment-server endpoints. Server-class settings are taken as
free-form --set KEY=VALUE so no field shape is assumed. Every mutation
routes through do_write for the dry-run/confirm/--yes/audit gate.

Closes #5
…objects (#6, #8)

Finish the hand-written pieces the CRUD specs cannot express:

HEC (#6):
- 'hec rotate NAME' regenerates a token's secret (printed once; the
  secret is never written to the audit log).
- 'hec global-enable' / 'global-disable' toggle the global HEC input.

Knowledge objects (#8):
- New 'tag' and 'datamodel' registry/factory groups (namespaced).
- 'datamodel accelerate NAME --enable/--disable' toggles acceleration.
- 'lookup upload --file CSV --app APP' registers a lookup table file
  (namespaced; requires an app).

Every mutation routes through do_write for the dry-run/confirm/--yes/
audit gate. Large or version-variable settings (tag linkage, datamodel
JSON) are taken as free-form --set KEY=VALUE rather than modeled fields.

Closes #6
Closes #8
…epth

# Conflicts:
#	.env.example
#	src/vct_splunk/cli.py
#	src/vct_splunk/commands/context.py
#	tests/unit/test_client.py
#	tests/unit/test_health.py
…feat/phase-10-kvstore-data

# Conflicts:
#	src/vct_splunk/cli.py
#	tests/unit/test_commands.py
… feat/phase-12-apps-deploy

# Conflicts:
#	tests/unit/test_commands.py
…feat/phase-13-hec-knowledge

# Conflicts:
#	src/vct_splunk/cli.py
#	tests/unit/test_commands.py
# Conflicts:
#	.env.example
# Conflicts:
#	tests/unit/test_resource_factory.py
…ommand-names

# Conflicts:
#	CHANGELOG.md
#	src/vct_splunk/cli.py
#	src/vct_splunk/commands/deploy.py
#	src/vct_splunk/core/acs/openapi/adminconfig-v2.json
#	src/vct_splunk/core/acs/operations.py
#	tests/integration/test_acs_public_spec.py
#	tests/unit/test_acs.py
#	tests/unit/test_app_deploy_contracts.py
#	tests/unit/test_cli_matrix.py
#	tests/unit/test_commands.py
Base automatically changed from chore/mit-license to main July 31, 2026 05:43
…ommand-names

# Conflicts:
#	tests/cli_catalog.py
@JacobPEvans-personal
JacobPEvans-personal merged commit 53ceb69 into main Jul 31, 2026
19 checks passed
@JacobPEvans-personal
JacobPEvans-personal deleted the refactor/deployment-command-names branch July 31, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant