| add-sqlA | dbabrain common.cli add-sql: A single-script SQL task and its target in one call (the older add-sql).
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): db_type (required): sqlserver | oracle. server_id (required): The machine. display_name (required): What a person reads. sql_text: The SQL. sql_file: Or a file of it. instance_name: The instance. service_name: A label. database_name: One database. credential_name: Which login in users.json; default: the instance's own. from_day: Schedule: first day. to_day: Schedule: last day. from_hour: Schedule: first hour. to_hour: Schedule: last hour. repeat_interval: Schedule: interval. timeout: Schedule: budget. inactive: Register switched off. manual_only: Only when asked for. output: none | chat | xlsx | csv. output_chat: Where the result goes. notify_chat: One level for both notifications. logging_chat: Progress level. error_chat: Failure level. logging_chat_id: Or a chat id. error_chat_id: Or a chat id. logging_on_run: false: no progress message. alert_on_error: false: no failure message. data_dir: Another data/ folder to read.
|
| app-command-setA | dbabrain common.cli app-command-set: An app command's schedule or state, changed field by field.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): app_code (required): Which command. active: Switched on. node_role: Which nodes run it. run_mode: sync | async. max_parallel: async: at most this many. time_window: A partial window: named fields change. sort_order: Where it is listed. display_name: Its title. note: Why. data_dir: Another data/ folder to read.
|
| askB | dbabrain common.cli ask: One question for the controlling terminal, and the answers it takes.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): prompt (required): The question, shown as written. choices: The accepted answers, lower case; none means any line is the answer. tries: How often a person is asked again after an answer not in choices. deadline_seconds: How long to wait for a line; nothing by then is no answer. answer: A reply the caller already collected, held to choices like a typed one.
|
| authorizeB | dbabrain common.cli authorize: A confirmation asked for on its own, for a caller that does the work itself.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): operation (required): The operation being authorised. target_id: What it will act on - the id typed back at level 100. target_label: How that target is shown. effects: What it will do, shown first. confirm: The payload declares the operator agreed. confirm_target: The second answer, when the operation costs two: the target's own id, typed back. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| backup-databaseA | dbabrain common.cli backup-database: One backup run on a host.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): db_type (required): The engine. host: The host. label: What to call it. level: full | diff | log. script: The engine script. script_path: Or its path. env: Values the script reads. server_metadata: Refused since 0.23.0 - the export resolves its instance from the inventory, and backup-database reads no configuration. Run sqlserver-export-instance after the backup. timeout: How long it may run. dry_run: Plan only: change nothing.
|
| backup-stopA | dbabrain common.cli backup-stop: One running backup to stop on its host: its process tree first, then its sessions.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): run_tag (required): The run's DBABRAIN_RUN_TAG, <backup_id>_<job_runs id>: its pid file /dbabrain_runs/.pid and its sessions' host_name dbabrain:. A-Z a-z 0-9 _ . -, at most 100. db_type (required): The run's engine; sqlserver also ends every session the run opened. host: Where the run is: hostcmd's block {runtime, host, port, access, username, password|key_file}, as backup-database took it. runtime windows runs the PowerShell stop. env: Resolved values: DOCKER_CONTAINER, MSSQL_SERVER, MSSQL_USER, MSSQL_PASSWORD - the run's own login. Any other key is not sent. timeout: Seconds the stop may take; default 120.
|
| build-showcaseB | dbabrain common.cli build-showcase: Where the published pages are, and where the showcase goes.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): source: The pages. output: The showcase folder. pattern: Which files. stamp: The day to show. allow: Terms allowed. extra_terms: More terms, each with its kind, for example {"SITECODE": "database"}. force: Replace an existing output. verify: Scan the output after.
|
| check-credentialsC | dbabrain common.cli check-credentials: Which data/ folder to check - against the reference, or for logins that resolve.
Request fields (pass them as request): |
| check-identifiersB | dbabrain common.cli check-identifiers: A tree to scan for this estate's identifiers.
Request fields (pass them as request): root: The tree. paths: Paths within it. allow: Terms allowed. extensions: File types. extra_terms: More terms to find. from_inventory: Take terms from the inventory. max_examples: Examples per term.
|
| check-objectsC | dbabrain common.cli check-objects: Which data/ folder to check - against the reference, or for logins that resolve.
Request fields (pass them as request): |
| check-referencesC | dbabrain common.cli check-references: Which data/ folder to check - against the reference, or for logins that resolve.
Request fields (pass them as request): |
| check-secretB | dbabrain common.cli check-secret: Which secret refs to prove by using them.
Request fields (pass them as request): refs: The refs; all when absent. match: Or a pattern. allow_name_host: Removed in 0.26.0: a request carrying true is refused. A secret is sent only to a host the configuration names for its ref - never to one read from the ref's name; a ref nothing names answers NO_TARGET. timeout_seconds: How long to wait.
|
| check-secret-literalsC | dbabrain common.cli check-secret-literals: A tree to scan for secret values.
Request fields (pass them as request): |
| copy-filesA | dbabrain common.cli copy-files: Named files copied from one host to another, removing nothing - a repository copy.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): files: The files, each {source, target, file_name, size_bytes, sha256} - all five required (0.37.0): source as the source host (or the share) names it, target an absolute path on the target host (a drive path on a windows ta... overwrite (required): false: a target name that already holds a file is left exactly as it is (the source is not read, the line fails saying so), and a copy lands only by a rename that refuses an existing name. true: the target name is rep... source: The SSH host the files are on: {host, port, username, password|key_file}. Or give source_share. source_share: Instead of source: a Windows share {host, share, username, password, domain?}, read with smbclient (or the UNC path on a Windows node); each file's source is then its path under the share. target: The SSH host the files go to: {host, port, username, password|key_file, platform}. Nothing there is ever removed but this copy's own partial file. platform windows (0.39.0): a Windows OpenSSH host - each file written ... timeout_seconds: Seconds the whole command may take; default 21600. A read or write that stalls for 300 s gives up its file, not the command. stall_seconds: Seconds one read or write may stop moving before its file is given up; default 300. transfer (required): How the bytes travel over SSH: cat (a plain cat channel with a large window, the source read ahead in a thread) or sftp (paramiko SFTP, read ahead and pipelined). Required - never assumed (0.37.0). encrypt: Encrypt on the way (0.38.0, 1.330): {recipients: [age1... public keys], key_id, key_expires_at}. Each file lands as .age and its plain bytes never reach the target; they are held to the line's size_bytes and s...
|
| copy-schemaB | dbabrain common.cli copy-schema: A schema to copy from one database into another.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): source: Where the schema is read from: {connection, database_name, schema} - connection is the complete login (db_type, host, port, username, password). The app that calls fills it from its own data/ (dbabrain.lib.data_source... destination: Where it is written: {connection, database_name, schema} - connection is the complete login. The app that calls fills it from its own data/ (dbabrain.lib.data_sources.request_fill); common.cli reads no configuration (... mode: plan | apply. tables: Which tables. include_tables: Only these. exclude_tables: Not these. modules: Which modules. include_modules: Only these. exclude_modules: Not these. with_data: Copy rows too. batch_size: Rows per batch. create_schema: Create it. skip_nonempty_tables: Leave a table with rows alone. map_filegroups: Filegroup mapping. partition_boundaries: Copy partition boundaries. module_passes: Passes over modules. phases: Which phases. plan: A plan to apply. verify: Compare after. report_unsupported: List what cannot be copied. assert_dest_instance: The instance it must be. lock_name: The application lock. lock_timeout_seconds: Waiting for it. target: The machine or instance: a server_id, or <db_type> <ip>[:port]. schema: The schema. database_name: One database. timeout_seconds: How long to wait. key: The secret-store passphrase, when not in the environment. key_base64: The same, base64.
|
| create-db-dockerA | dbabrain common.cli create-db-docker: One lab database Docker instance to build.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): name (required): The instance's name: folder, compose project and container. engine (required): postgres | mysql | mssql | oracle | oracle-xe. version (required): The image tag, checked against the registry first. mode: single (default) | ha-lab. replicas: ha-lab only: standbys. Omitted = the engine's default. host_port: The host port of the primary. Omitted = the engine's own. password_ref: The secret REF the connection record names. password: Its RESOLVED value. A dry run may omit it. backup_mount: Host folder bind-mounted at the same path; empty = none. Omitted means nothing stated: no mount for an engine that needs none, and refused by name for one that mounts its backup folder (SQL Server) - the node's own is... network_subnet: The compose network's /24. Omitted = derived from the name. data_host_dir: PostgreSQL single only (0.37.0): keep the data in this host folder, bound at /var/lib/postgresql, instead of a Docker named volume - e.g. on a share. Absent: the named volume. run_as: The uid:gid the container runs as (0.37.0) - for a host folder whose files only one uid can own, such as an NFS share that maps every user to one uid. Absent: the image's own user. timezone: A single instance (0.40.0): the container's TZ - the clock its database reads its own time in. Absent: the image's own, UTC. containers_dir (required): Where the instance folder is written on its host. Stated by the caller - the node's own is sre.docker_db.containers_dir - because the command reads no configuration and assumes no folder; a request without it is refus... worker_host: The address recorded for an instance built on this machine. remote: Build on this Ubuntu host over SSH. An ssh_login object: host, port (22), username, and a RESOLVED password or an absolute key_file path - never a ref; label names it in messages. install_docker: With remote: install Docker and prepare the folders first. Never on a dry run. sudo_password: With install_docker: sudo's password. Omitted = the SSH one. health_timeout: How long to wait for health. Omitted = the engine's own ceiling. force: Rebuild an existing instance - destroys its containers and volumes. dry_run: Render the plan; connect to nothing, change nothing.
|
| create-table-from-xlsxA | dbabrain common.cli create-table-from-xlsx: A spreadsheet or CSV loaded into a new table.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. sql_access: How to reach the SQL engine, overriding the instance's block. database_name: One database. schema: The schema. table_name: The table; generated when absent. file_path: The file here. file_base64: Or its bytes. delimiter: csv: the delimiter. if_exists: fail | replace. load_rows: Insert the rows, not just create the table. max_rows: At most this many rows. text_length: The width of every text column. timeout_seconds: How long to wait. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an...
|
| credential-removeA | dbabrain common.cli credential-remove: One login of users.json to remove, by its credential_name; a plan unless apply.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): data_dir: The data/ folder the record is removed from. credential_name (required): The login to remove. server_id: The server whose login it is, where several servers' groups share the name. apply: true removes the record; absent or false answers the plan and writes nothing.
|
| db-activityC | dbabrain common.cli db-activity: One database object or the server's activity read: a table, a definition, what runs now, a plan.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. sql_access: How to reach the SQL engine - the inventory's (the 8i bridge). database_name: The database to read in; SQL Server: else master. object: table-info / object-source: the object, name, schema.name or [schema].[name]. view: db-activity: requests (default) | blocking | waits | top_queries. sql_text: query-plan: the one statement to compile - never run. max_rows: db-activity: rows at most, 1 to 1000 (default 50). timeout_seconds: How long to wait. connection: The database login, complete: db_type, host, port, username, password. The app that calls fills it from its own data/ (dbabrain.lib.data_sources.request_fill); common.cli reads no configuration (rules R09).
|
| db-statusB | dbabrain common.cli db-status: How deep to check an instance.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. depth: instance | database | schema. database_name: One database. database_names: Which databases, at depth database. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an...
|
| delete-empty-folderA | dbabrain common.cli delete-empty-folder: ONE folder deleted only when it holds nothing at all - hidden entries count (0.37.0).
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: Where the file is: {runtime (windows | linux | docker | k8s - stated), access (ssh | winrm), host, port, username, password | key_file, container, sudo}; left out, this machine. path (required): The one folder, in full; never a pattern, never a list. must_be_under (required): The folder the path must be strictly inside; the fence itself is never deleted. dry_run: Count its entries, delete nothing. timeout_seconds: Seconds the host may take - the hash runs at disk speed; default 3600.
|
| delete-empty-foldersA | dbabrain common.cli delete-empty-folders: A list of empty folders, each deleted as delete-empty-folder deletes one, in the order given (deepest first); the first not deleted stops the list (0.37.0).
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: Where the file is: {runtime (windows | linux | docker | k8s - stated), access (ssh | winrm), host, port, username, password | key_file, container, sudo}; left out, this machine. folders (required): The folders, at most 20000, deepest first: each {path, must_be_under}. A parent before its child is refused as not empty and stops the list. dry_run: Check every fact, delete nothing. timeout_seconds: Seconds each item may take on the host (its hash runs at disk speed); default 3600.
|
| delete-fileA | dbabrain common.cli delete-file: ONE stray file to delete by force, inside a named folder (delete-files is refused).
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: Where the file is: {runtime (windows | linux | docker | k8s), access (ssh | winrm), host, port, username, password | key_file, container, sudo}; omitted = this machine. path: The ONE file, by its absolute path - never a pattern, never a folder. paths: A list of files: REFUSED since 0.38.0, by delete-files whatever else the request carries and by delete-file before the host is reached. must_be_under (required): The folder the file must be strictly inside; the fence itself is never deleted. force: delete-file: must be true - this file has no stored facts to be held to. Without it the command refuses and names delete-verified-file. dry_run: Measure the file and answer what would be deleted; delete nothing. timeout_seconds: Seconds the host may take: the file is hashed at disk speed.
|
| delete-verified-fileA | dbabrain common.cli delete-verified-file: ONE file deleted only when its name, path, bytes and sha256 are all true on the host (0.37.0).
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: Where the file is: {runtime (windows | linux | docker | k8s - stated), access (ssh | winrm), host, port, username, password | key_file, container, sudo}; left out, this machine. path (required): The one file, in full; never a pattern, never a list (paths is refused). file_name (required): The file's name - the last part of path. size_bytes (required): The bytes it must measure on the host now. sha256 (required): The sha256 it must hash to on the host now - 64 hexadecimal characters. must_be_under (required): The folder the path must be strictly inside; the fence itself is never deleted. dry_run: Check every fact, delete nothing. timeout_seconds: Seconds the host may take - the hash runs at disk speed; default 3600.
|
| delete-verified-filesA | dbabrain common.cli delete-verified-files: A list of files, each deleted as delete-verified-file deletes one - its own facts, its own script, over one connection; the first not deleted stops the list (0.37.0).
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: Where the file is: {runtime (windows | linux | docker | k8s - stated), access (ssh | winrm), host, port, username, password | key_file, container, sudo}; left out, this machine. files (required): The files, at most 20000: each {path, file_name, size_bytes, sha256, must_be_under} - every fact required on every item, no other field. One bad or repeated item refuses the whole list before the host is reached. dry_run: Check every fact, delete nothing. timeout_seconds: Seconds each item may take on the host (its hash runs at disk speed); default 3600.
|
| describe-objectC | dbabrain common.cli describe-object: Which object, or which field of it, to describe.
Request fields (pass them as request): |
| disable-jobB | dbabrain common.cli disable-job: A break-glass SQL Server action: shrink a log, kill a session, start or disable a job.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. server_id: The instance, when not in target. sql_access: How to reach the SQL engine, overriding the instance's block. database_name: One database. size_mb: shrink-log: the size to shrink to. spid: kill-spid: the session. report_rollback: kill-spid: report the rollback's progress. job_name: start-job / disable-job: the Agent job. override: Accept a blocking gate. timeout_seconds: How long to wait. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| due-checkB | dbabrain common.cli due-check: A schedule and its last run, asked whether it is due.
Request fields (pass them as request): time_window: The schedule. row: A store row instead of last_run / last_status. last_run: The previous run's start. last_status: done | error | timeout | running. now: The instant to judge at (UTC). local_now: The same in local time - checks the hours. retry_default: The app's retry fallback. timeout_default: The app's timeout fallback. default_repeat: The app's interval fallback.
|
| encrypt-fileA | dbabrain common.cli encrypt-file: ONE file encrypted with age where it lies on the repository, for a key's public half only (0.37.0).
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host (required): Where the file is: {runtime (linux | docker | k8s), host, port, username, password | key_file, sudo}. path (required): The one plain file, in full. file_name (required): The last part of path - stated, and held to it. size_bytes (required): The plain file's bytes, as the catalog proved them. sha256 (required): The plain file's sha256, as the catalog proved it. must_be_under (required): The repository folder path must be strictly under. recipients (required): The key's public half (age1...). key_id (required): The key's number in the runtime store. key_expires_at (required): When the key stops encrypting (UTC) - refused at and after it. timeout_seconds: Seconds the host may take; default 3600.
|
| encrypt-secretA | dbabrain common.cli encrypt-secret: The plaintext secret source and the encrypted store to write; never the passphrase.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): source: The plaintext file; default secrets/secret_text.json. dest: The encrypted store; default data/encrypted_secret_text.json. format: json (the envelope, default) or txt (the lines a person reads).
|
| entry-removeA | dbabrain common.cli entry-remove: One record of a data/*.json list to remove, found by its fields; a plan unless apply.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): data_dir: The data/ folder the record is removed from. file (required): The data/*.json file name. match (required): The record's fields; exactly one record must match. Its own key (backup_id, restore_id, id, name, ...) is its name; a record told only by a field pointing elsewhere names nothing. apply: true removes the record; absent or false answers the plan and writes nothing.
|
| export-dataA | dbabrain common.cli export-data: Which tool root to carry, into which bundle file, with or without secrets and assets.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): bundle: The bundle file to write. Required. root: The tool root to export; default the one resolved. include_secrets: Carry the encrypted secret store; default true. include_assets: Carry assets/ and data/ssh_keys/; default true. force: Overwrite an existing bundle file. format: json (the envelope, default) or txt (the lines a person reads).
|
| fetch-fileC | dbabrain common.cli fetch-file: A file fetched, sent, packed or relayed over the host's own access.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: A label for the answer - the server_id. Nothing is looked up by it: common.cli reads no configuration (rules R09). server_id: The same label, when not in target. access: The host login, complete: an inline cmd_access - method (ssh|winrm), host, port, username, auth_type, key_file or password - with the machine's platform and runtime facts. The app that calls fills it from its own data... remote_path: fetch/send: the file on the host. local_path: fetch/send: the file here. overwrite: Replace an existing file. make_dirs: Create missing folders. files: pack-files: the files. folder: pack-files: or a folder. include: pack-files: patterns within it. format: pack-files: tar | tar.gz | zip. archive_path: pack-files: the archive. checksum_files: pack-files: hash each member. source: relay-file: {access, target, path} - each side states its own login. destination: relay-file: {access, target, path}.
|
| file-checksumA | dbabrain common.cli file-checksum: Files hashed on the host that holds them.
Request fields (pass them as request): paths: The files to hash, full paths as that host sees them - or give folder instead. algorithm: sha256 - the only one; stated so another is a choice, not a surprise. host: Where the files are: hostcmd's block {runtime, host, port, access, username, password|key_file, container, pod}. Omit it to hash on this machine. timeout_seconds: Seconds one batch may take; default 3600 - a large FULL hashes at disk speed. folder: Instead of paths: every file under this folder, listed on the host (find, or Get-ChildItem -Recurse) and hashed there - a catalog backfill (0.34.0). include: With folder: file name patterns, case-insensitive ("*.bak"); default every file. container: With folder: the folder is a path inside this container, translated to the host's through its mounts (docker inspect). max_files: With folder: at most this many files (default 5000); more is answered as truncated, never cut silently.
|
| finish-stagingA | dbabrain common.cli finish-staging: The files that just travelled into a staging, to be given their source's times, and the folder to open for the engine.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target (required): The target host's SSH login: host, port, username and a RESOLVED password or key_file (an absolute path), open_timeout_seconds - never a secret ref: common resolves nothing; platform: linux (also when absent) or windo... target_dir (required): The staging directory on the target host - on a windows login a drive path (C:/dbabrain_restore/<restore_id>, either separator); a drive path on any other login is refused. files: The files copy-files landed: {path (relative to target_dir), mtime (the source's, epoch seconds; null leaves the file's time alone)} - prepare-staging's pending. open_for_engine: chmod -R a+rX on the target after, for the engine's own uid. Default true. On a windows target nothing is changed: SQL Server's service account reads the folder through its ACL, granted once by the operator.
|
| guideA | dbabrain common.cli guide: The operating guide, printed or written as AGENTS.md.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): write: Write it as AGENTS.md instead of printing it. root: Where to write it; default the current directory. format: json (the envelope, default) or txt (the lines a person reads).
|
| host-factsC | dbabrain common.cli host-facts: A gated action on a host: facts, a service, a restart.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. access: An inline cmd_access, for a host outside the inventory. platform: windows | linux, when the inventory does not say. action: host-service: status | start | stop | restart. services: host-service: which services. wait: Wait for the end state. window: The maintenance window it must fall in. ignore_window: Run outside that window, deliberately. overrides: Blocking gates accepted on purpose. evidence: Where to write the evidence file. sudo: Run through sudo on Linux. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. policy: The maintenance policy that times this host operation: the node's maintenance_policy.json defaults with this server's own values over them. {} means the built-in defaults. The app that calls fills it from its own data... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| host-restartB | dbabrain common.cli host-restart: A gated action on a host: facts, a service, a restart.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. access: An inline cmd_access, for a host outside the inventory. platform: windows | linux, when the inventory does not say. action: host-service: status | start | stop | restart. services: host-service: which services. wait: Wait for the end state. window: The maintenance window it must fall in. ignore_window: Run outside that window, deliberately. overrides: Blocking gates accepted on purpose. evidence: Where to write the evidence file. sudo: Run through sudo on Linux. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. policy: The maintenance policy that times this host operation: the node's maintenance_policy.json defaults with this server's own values over them. {} means the built-in defaults. The app that calls fills it from its own data... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| host-serviceB | dbabrain common.cli host-service: A gated action on a host: facts, a service, a restart.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. access: An inline cmd_access, for a host outside the inventory. platform: windows | linux, when the inventory does not say. action: host-service: status | start | stop | restart. services: host-service: which services. wait: Wait for the end state. window: The maintenance window it must fall in. ignore_window: Run outside that window, deliberately. overrides: Blocking gates accepted on purpose. evidence: Where to write the evidence file. sudo: Run through sudo on Linux. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. policy: The maintenance policy that times this host operation: the node's maintenance_policy.json defaults with this server's own values over them. {} means the built-in defaults. The app that calls fills it from its own data... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| import-dataA | dbabrain common.cli import-data: Which bundle to apply to which tool root, as a plan or for real.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): bundle: The bundle file to read. Required. root: The tool root to write into; default the one resolved. plan_only: Report what would be written and change nothing. force: Replace files that exist with different content. include_secrets: Write the secret store if the bundle carries one; default true. include_assets: Write assets/ and data/ssh_keys/; default true. format: json (the envelope, default) or txt (the lines a person reads).
|
| initB | dbabrain common.cli init: Create a tool root: the directory, the app name, and whether to overwrite.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): root: The directory to initialise; default the current one. app_name: The app name config.json carries; default dbabrain. force: Overwrite files that already exist. format: json (the envelope, default) or txt (the lines a person reads).
|
| instance-activeA | dbabrain common.cli instance-active: One instance switched on or off for every app - its active flag.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): server_id (required): The instance, as written in db_instances.json. active (required): true switches the record on for every app, false off. metrics.enabled is metric-toggle's. data_dir: Another data/ folder to read.
|
| instance-addA | dbabrain common.cli instance-add: An instance to register, with its login.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): server_id (required): Its name everywhere. db_type (required): The engine. ip (required): Its address. site (required): Which site or company the machine belongs to. Required to register; a keep_default request writes no inventory field and carries none. environment (required): Whether the machine is production, and how a person groups it. Required to register - a restore onto a target whose record states no environment is refused, and only the owner knows it; a keep_default request carries ... port: Its port. service_name: A label. database_name: One database. username: The login. password: Its password - encrypted, never written. password_ref: Or an existing secret. credential_name: Which login in users.json; default: the instance's own. role: What the login is for. replace: Overwrite an existing server_id. active: Registered switched on (default) or off. keep_default: Add this login beside a registered server's default, which stays its default: no inventory field is written.
|
| instance-removeA | dbabrain common.cli instance-remove: One server's record of db_instances.json to remove; a plan unless apply.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): data_dir: The data/ folder the record is removed from. server_id (required): The server to remove. apply: true removes the record; absent or false answers the plan and writes nothing.
|
| inventory-summaryB | dbabrain common.cli inventory-summary: The inventory to summarise.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): inventory: The inventory file. overlay: An overlay on it. app_commands: The app commands file. date: The day to summarise. output_dir: Where the page goes.
|
| key-renewA | dbabrain common.cli key-renew: Get this node a dbabrain key from dbabrain.dev: an email sign-in, the key into the encrypted store.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): node: How the key names this machine - shown on dbabrain.dev and in key-status, never trusted. server: The service that issues keys. wait: Wait for the approval with no terminal - when a person reads this command's output (worker-run). Without it and without a terminal the command is refused.
|
| key-requestA | dbabrain common.cli key-request: Get this node a dbabrain key from dbabrain.dev: an email sign-in, the key into the encrypted store.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): node: How the key names this machine - shown on dbabrain.dev and in key-status, never trusted. server: The service that issues keys. wait: Wait for the approval with no terminal - when a person reads this command's output (worker-run). Without it and without a terminal the command is refused.
|
| key-statusA | dbabrain common.cli key-status: This node's dbabrain key read offline, and dbabrain.dev's answer about it.
Request fields (pass them as request): |
| kill-spidA | dbabrain common.cli kill-spid: A break-glass SQL Server action: shrink a log, kill a session, start or disable a job.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. server_id: The instance, when not in target. sql_access: How to reach the SQL engine, overriding the instance's block. database_name: One database. size_mb: shrink-log: the size to shrink to. spid: kill-spid: the session. report_rollback: kill-spid: report the rollback's progress. job_name: start-job / disable-job: the Agent job. override: Accept a blocking gate. timeout_seconds: How long to wait. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| lift-exampleB | dbabrain common.cli lift-example: A config file to copy into an example.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): source (required): The file. destination: The example. blank_keys: Keys to empty. write: Write it (default) or only report.
|
| list-backup-filesA | dbabrain common.cli list-backup-files: Which backup files a directory holds, or which a retention rule would remove.
Request fields (pass them as request): db_type (required): The engine the files belong to. host: The host holding them. target: SQL Server: the instance that lists its own backup folder - {host, port, username, password}. path (required): The directory. database_name: One database. kinds: full | diff | log. latest: Only the newest per database and kind. after: Newer than this instant. before: Older than this instant. mode: prune: how obsolescence is judged. cleanup_retention: prune: how long files are kept. delete: prune: true is REFUSED since 0.38.0 - the command answers the plan and deletes nothing. timeout_seconds: How long to wait. wal_segments: PostgreSQL (0.35.0, 1.250): answer every segment name under wal/ on the log row - what a restore's WAL continuity is read from. Off by default: a cluster archives thousands.
|
| list-databasesB | dbabrain common.cli list-databases: One instance's databases, schemas or jobs listed.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. sql_access: How to reach the SQL engine, overriding the instance's block. database_name: One database. include_system: Include system objects. enabled_only: list-jobs: only enabled jobs. timeout_seconds: How long to wait. key: The secret-store passphrase, when not in the environment. key_base64: The same, base64. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an...
|
| list-filesA | dbabrain common.cli list-files: Every entry under a folder - kind, bytes, time - without hashing (0.37.0).
Request fields (pass them as request): host: Where the folder is: {runtime (windows | linux | docker | k8s), access (ssh | winrm), host, port, username, password | key_file, container, sudo}; left out, this machine. folder (required): The absolute folder to list; not there is folder_found false. max_files: The most entries answered; more is truncated, never cut silently. timeout_seconds: Seconds the listing may take on the host. with_folders: True also answers every folder under the folder, as folders (0.38.0) - what a staging cleanup names an emptied backup set's folders from.
|
| list-jobsB | dbabrain common.cli list-jobs: One instance's databases, schemas or jobs listed.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. sql_access: How to reach the SQL engine, overriding the instance's block. database_name: One database. include_system: Include system objects. enabled_only: list-jobs: only enabled jobs. timeout_seconds: How long to wait. key: The secret-store passphrase, when not in the environment. key_base64: The same, base64. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an...
|
| list-schemasB | dbabrain common.cli list-schemas: One instance's databases, schemas or jobs listed.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. sql_access: How to reach the SQL engine, overriding the instance's block. database_name: One database. include_system: Include system objects. enabled_only: list-jobs: only enabled jobs. timeout_seconds: How long to wait. key: The secret-store passphrase, when not in the environment. key_base64: The same, base64. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an...
|
| list-targetsC | dbabrain common.cli list-targets: A listing that takes nothing but its format.
Request fields (pass them as request): |
| metric-batchB | dbabrain common.cli metric-batch: One target's metric items, run one after another - the metrics app's execution.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target (required): The target's connection facts, resolved: target_id, db_type, host, port, database ("" = the engine's default, master on SQL Server), service_name, sqlserver_driver, sqlserver_tls_verify, username and password; or the ... secrets: {ref: value} for exactly the secret refs this target's configuration names (a remote login's password_ref, the bridge's secret_ref) - never the whole store. items (required): One per metric, run in order: {id, kind: sql, sql, timeout_seconds, max_rows, per_database, max_databases} | {id, kind: script, script, shell, access, credential, env, timeout_seconds} | {id, kind: local, path, env, t...
|
| metric-envA | dbabrain common.cli metric-env: The inputs a collector script reads from one instance, set or removed.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): server_id (required): The instance, as written in db_instances.json. env (required): {NAME: value}: written to metrics.collector_env; a value of null removes NAME. A name carrying a secret is refused - metrics.env_secrets maps it to a ref. metric_code: The variables go to that metric's own block (metric_overrides..collector_env), which wins over the target's. data_dir: Another data/ folder to read.
|
| metric-severityA | dbabrain common.cli metric-severity: How one metric's statuses are remapped for one instance - or a list of such remaps, written together.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): server_id: The instance. Required in the one-remap form; absent beside items. metric_code: The metric. Required in the one-remap form; absent beside items. "*" is every metric of the server - metrics.severity_map, under each metric's own map, which still wins; it takes no metric_item. metric_item: One item of it. severity_map: {STATUS: STATUS}. note: Why. items: Several remaps written together, every one or none: each {server_id, metric_code, metric_item, severity_map, note}. With items, the request carries nothing else but data_dir. data_dir: Another data/ folder to read.
|
| metric-toggleA | dbabrain common.cli metric-toggle: A metric, a collector type or all of them switched on or off for one instance.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): server_id (required): The instance. scope (required): all | a collector type | a METRIC_CODE. state (required): on | off. reason: With state off and a METRIC_CODE scope: why the metric is off, written as metric_overrides..disabled_reason. Refused with state on or another scope; switching the metric on clears it. data_dir: Another data/ folder to read.
|
| move-db-dockerA | dbabrain common.cli move-db-docker: One lab database Docker instance to move, data included.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): name (required): The instance: its folder name and compose project. engine (required): Its engine, for the health probe. The caller reads it from the registry. source (required): Where it runs now. An ssh_login object: host, port (22), username, and a RESOLVED password or an absolute key_file path - never a ref; label names it in messages. destination (required): Where it goes. An ssh_login object: host, port (22), username, and a RESOLVED password or an absolute key_file path - never a ref; label names it in messages. containers_dir (required): Instance folders on the source: the lab is found under this folder and its name. Stated by the caller - the node's own is sre.docker_db.containers_dir; a request without it is refused by name. dest_containers_dir: Instance folders on the destination. Omitted = the source's. stage_dir: Where the bundle is written on both hosts. include_volumes: Ship the volumes' contents (default true). false = an EMPTY database there. commit_container: Ship the container's own filesystem too - for an engine writing outside its volumes. stop_source: Stop the source once the destination is healthy (kept, not removed). keep_stage: Leave the bundle on both hosts. force: Replace an instance of the same name on the destination - destroys it. health_timeout: How long to wait for health. Omitted = the engine's own ceiling. dry_run: Read the source and say what would move; change nothing.
|
| object-sourceB | dbabrain common.cli object-source: One database object or the server's activity read: a table, a definition, what runs now, a plan.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. sql_access: How to reach the SQL engine - the inventory's (the 8i bridge). database_name: The database to read in; SQL Server: else master. object: table-info / object-source: the object, name, schema.name or [schema].[name]. view: db-activity: requests (default) | blocking | waits | top_queries. sql_text: query-plan: the one statement to compile - never run. max_rows: db-activity: rows at most, 1 to 1000 (default 50). timeout_seconds: How long to wait. connection: The database login, complete: db_type, host, port, username, password. The app that calls fills it from its own data/ (dbabrain.lib.data_sources.request_fill); common.cli reads no configuration (rules R09).
|
| pack-backupA | dbabrain common.cli pack-backup: A backup folder packed, or one file pulled or pushed, with checksums.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: The host: {host, port, username, password|key_file}. folder: pack-backup: the folder. files: pack-backup: or named files. archive_path: pack-backup: the archive. format: pack-backup: tar | tar.gz. remote_path: pull/push: the file there. local_path: pull/push: the file here. sha256: The checksum it must match. timeout_seconds: How long to wait.
|
| pack-filesC | dbabrain common.cli pack-files: A file fetched, sent, packed or relayed over the host's own access.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: A label for the answer - the server_id. Nothing is looked up by it: common.cli reads no configuration (rules R09). server_id: The same label, when not in target. access: The host login, complete: an inline cmd_access - method (ssh|winrm), host, port, username, auth_type, key_file or password - with the machine's platform and runtime facts. The app that calls fills it from its own data... remote_path: fetch/send: the file on the host. local_path: fetch/send: the file here. overwrite: Replace an existing file. make_dirs: Create missing folders. files: pack-files: the files. folder: pack-files: or a folder. include: pack-files: patterns within it. format: pack-files: tar | tar.gz | zip. archive_path: pack-files: the archive. checksum_files: pack-files: hash each member. source: relay-file: {access, target, path} - each side states its own login. destination: relay-file: {access, target, path}.
|
| prepare-stagingA | dbabrain common.cli prepare-staging: A restore's staging folder to make ready for a backup directory's files, and the question of which still have to travel.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): source: The source host's SSH login: host, port, username and a RESOLVED password or key_file (an absolute path), open_timeout_seconds - never a secret ref: common resolves nothing; platform: linux (also when absent) or windo... source_dir: The backup directory on the source host. target: The target host's SSH login: host, port, username and a RESOLVED password or key_file (an absolute path), open_timeout_seconds - never a secret ref: common resolves nothing; platform: linux (also when absent) or windo... target_dir: The staging directory on the target host - on a windows login a drive path (C:/dbabrain_restore/<restore_id>, either separator); a drive path on any other login is refused. chain: Read the chain from the source: {db_type (postgresql | oracle | sqlserver), backup_dir (oracle: the path RMAN's catalog names), container (oracle: where RMAN runs), point_in_time (set: the chain that reaches the momen... include: Path prefixes the restore needs; empty = everything. Stated, it is used as it is; absent, chain reads it from the source. window_hours: Also copy every file the source wrote in the last N hours, beside the include - copy_selection window. Ignored when include is empty (everything is copied). make_readable: When something under source_dir is not readable by the login: sudo -n chmod -R a+rX on it first (a live archivelog job writes 0640). Never asks for a password - where sudo needs one it is refused at once and the listi... space_check: The room the files still to copy must find on the target before the first one moves: free >= bytes x factor. A restore entry's own space_check, handed on by the app; the same object, the same defaults. staging_marker: The name of the file that marks target_dir as this tool's staging folder: only a marked folder is mirrored, and an unmarked one that shares no file with the source is refused. A restore entry's own staging_marker, han... replace: Relative paths that travel even when the target holds them at the same size and not older: a copy the caller's checksum gate found different. plan_only: true: answer only the files the request selects (and the chain, when asked), read from the source; the target is not opened and nothing is prepared. incoming: Instead of a source (0.39.0): the files the caller already knows, relative to target_dir with their sizes - the target half alone: the folder made, marked and proven writable, the room for the files not there yet at t... dry_run: With incoming (0.39.0): read only - whether target_dir is there and whose, which files are there already, and whether the rest fit, each a verdict; nothing is made or written. Refused without incoming.
|
| probe-hostA | dbabrain common.cli probe-host: A host to probe for its management ports.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: A label for the answer - the server_id. Nothing is looked up by it: common.cli reads no configuration (rules R09). host: The address to probe - required. The app that holds a server_id fills it, with the OS, from its own data/ (dbabrain.lib.data_sources.request_fill). ports: Which ports. timeout_seconds: How long to wait.
|
| prune-backup-filesA | dbabrain common.cli prune-backup-files: Which backup files a directory holds, or which a retention rule would remove.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): db_type (required): The engine the files belong to. host: The host holding them. target: SQL Server: the instance that lists its own backup folder - {host, port, username, password}. path (required): The directory. database_name: One database. kinds: full | diff | log. latest: Only the newest per database and kind. after: Newer than this instant. before: Older than this instant. mode: prune: how obsolescence is judged. cleanup_retention: prune: how long files are kept. delete: prune: true is REFUSED since 0.38.0 - the command answers the plan and deletes nothing. timeout_seconds: How long to wait. wal_segments: PostgreSQL (0.35.0, 1.250): answer every segment name under wal/ on the log row - what a restore's WAL continuity is read from. Off by default: a cluster archives thousands.
|
| pull-fileC | dbabrain common.cli pull-file: A backup folder packed, or one file pulled or pushed, with checksums.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: The host: {host, port, username, password|key_file}. folder: pack-backup: the folder. files: pack-backup: or named files. archive_path: pack-backup: the archive. format: pack-backup: tar | tar.gz. remote_path: pull/push: the file there. local_path: pull/push: the file here. sha256: The checksum it must match. timeout_seconds: How long to wait.
|
| push-fileB | dbabrain common.cli push-file: A backup folder packed, or one file pulled or pushed, with checksums.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: The host: {host, port, username, password|key_file}. folder: pack-backup: the folder. files: pack-backup: or named files. archive_path: pack-backup: the archive. format: pack-backup: tar | tar.gz. remote_path: pull/push: the file there. local_path: pull/push: the file here. sha256: The checksum it must match. timeout_seconds: How long to wait.
|
| query-planA | dbabrain common.cli query-plan: One database object or the server's activity read: a table, a definition, what runs now, a plan.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. sql_access: How to reach the SQL engine - the inventory's (the 8i bridge). database_name: The database to read in; SQL Server: else master. object: table-info / object-source: the object, name, schema.name or [schema].[name]. view: db-activity: requests (default) | blocking | waits | top_queries. sql_text: query-plan: the one statement to compile - never run. max_rows: db-activity: rows at most, 1 to 1000 (default 50). timeout_seconds: How long to wait. connection: The database login, complete: db_type, host, port, username, password. The app that calls fills it from its own data/ (dbabrain.lib.data_sources.request_fill); common.cli reads no configuration (rules R09).
|
| read-fileA | dbabrain common.cli read-file: ONE small file read on its host, its bytes proven by size and sha256 (0.37.0).
Request fields (pass them as request): host: Where the file is: {runtime (windows | linux | docker | k8s), access, host, port, username, password | key_file, container, sudo}; left out, this machine. path (required): The one file, in full - never a pattern, a link or a '..' segment. max_bytes: The largest file read; default 1048576, at most 16777216. timeout_seconds: Seconds the host may take; default 120.
|
| relay-fileB | dbabrain common.cli relay-file: A file fetched, sent, packed or relayed over the host's own access.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: A label for the answer - the server_id. Nothing is looked up by it: common.cli reads no configuration (rules R09). server_id: The same label, when not in target. access: The host login, complete: an inline cmd_access - method (ssh|winrm), host, port, username, auth_type, key_file or password - with the machine's platform and runtime facts. The app that calls fills it from its own data... remote_path: fetch/send: the file on the host. local_path: fetch/send: the file here. overwrite: Replace an existing file. make_dirs: Create missing folders. files: pack-files: the files. folder: pack-files: or a folder. include: pack-files: patterns within it. format: pack-files: tar | tar.gz | zip. archive_path: pack-files: the archive. checksum_files: pack-files: hash each member. source: relay-file: {access, target, path} - each side states its own login. destination: relay-file: {access, target, path}.
|
| remote-credential-addB | dbabrain common.cli remote-credential-add: An OS login to register, and the cmd_access that names it.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): server_id (required): The machine. host: Its address. server_description: What it is. username (required): The OS account. password: Its password - encrypted, never written. password_ref: Or an existing secret. auth_type: password | key. key_file: The key, for key auth. credential_name: Which login in users.json; default: the instance's own. role: A label. account_owner: Who owns the account. note: Why it exists. method: ssh | winrm - write the cmd_access too. platform: windows | linux. port: The port. shell: The shell. ssl: winrm: TLS. enabled: The cmd_access block's own switch. replace: Overwrite an existing one.
|
| report-server-removeA | dbabrain common.cli report-server-remove: One server to take off the report's canonical inventory; a plan unless apply.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): data_dir: The data/ folder the record is removed from. server_id (required): The server to take off. inventory: The canonical inventory's path. apply: true removes the record; absent or false answers the plan and writes nothing.
|
| restore-diffB | dbabrain common.cli restore-diff: One restore step on one engine.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): db_type (required): The engine. target: The instance - an input_remote_target. sqlcmd: SQL Server: run the step with sqlcmd where the server is instead of a driver from here - the run-sqlcmd request less its sql (instance, sqlcmd_path, username, password, timeouts, via, host). One file per call; the ans... backup_path: The backup. backup_paths: Several, in order. database_name: One database. move: SQL Server: file moves. move_files: SQL Server full: {data, log} - where the two files go; the logical names are read on the server (RESTORE FILELISTONLY), and the database goes SINGLE_USER first. relocate: SQL Server full onto another server: every file RESTORE FILELISTONLY names goes to the target's default data / log folder - or data_dir / log_dir - as _; {} for both defaults; the database goes SI... replace: SQL Server: WITH REPLACE. overwrite_existing: Whether the step may replace what the target holds; without true it stops first (0.26.0, G2.10; every engine and any state since 0.39.0). SQL Server full: a database of that name in any state raises before the batch t... stats: SQL Server: progress every n percent. with_recovery: Bring it online after. stopat: A point in time. host: Oracle / PostgreSQL: the host. backup_location: Oracle: where the pieces are. encryption_password: Oracle: the backup's password. mode: Oracle: the RMAN mode. oracle_sid: Oracle: the SID. bin_dir: PostgreSQL: the binaries. data_dir: PostgreSQL: the data directory. run_as: PostgreSQL: the OS user. staging_dir: PostgreSQL: where pieces are staged. wal_dir: PostgreSQL: the WAL archive. dry_run: Plan only: change nothing. timeout_seconds: How long to wait. recovery_timeout_seconds: PostgreSQL into a container, with wal_dir: how long to wait for recovery to end (default 1800). A container that stops or restarts ends the wait at once.
|
| restore-fullB | dbabrain common.cli restore-full: One restore step on one engine.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): db_type (required): The engine. target: The instance - an input_remote_target. sqlcmd: SQL Server: run the step with sqlcmd where the server is instead of a driver from here - the run-sqlcmd request less its sql (instance, sqlcmd_path, username, password, timeouts, via, host). One file per call; the ans... backup_path: The backup. backup_paths: Several, in order. database_name: One database. move: SQL Server: file moves. move_files: SQL Server full: {data, log} - where the two files go; the logical names are read on the server (RESTORE FILELISTONLY), and the database goes SINGLE_USER first. relocate: SQL Server full onto another server: every file RESTORE FILELISTONLY names goes to the target's default data / log folder - or data_dir / log_dir - as _; {} for both defaults; the database goes SI... replace: SQL Server: WITH REPLACE. overwrite_existing: Whether the step may replace what the target holds; without true it stops first (0.26.0, G2.10; every engine and any state since 0.39.0). SQL Server full: a database of that name in any state raises before the batch t... stats: SQL Server: progress every n percent. with_recovery: Bring it online after. stopat: A point in time. host: Oracle / PostgreSQL: the host. backup_location: Oracle: where the pieces are. encryption_password: Oracle: the backup's password. mode: Oracle: the RMAN mode. oracle_sid: Oracle: the SID. bin_dir: PostgreSQL: the binaries. data_dir: PostgreSQL: the data directory. run_as: PostgreSQL: the OS user. staging_dir: PostgreSQL: where pieces are staged. wal_dir: PostgreSQL: the WAL archive. dry_run: Plan only: change nothing. timeout_seconds: How long to wait. recovery_timeout_seconds: PostgreSQL into a container, with wal_dir: how long to wait for recovery to end (default 1800). A container that stops or restarts ends the wait at once.
|
| restore-keyA | dbabrain common.cli restore-key: A backup-encryption certificate to import.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The instance. sqlcmd: Run it where the SQL Server is: the run-sqlcmd request without its sql - for an instance this machine cannot reach over a driver. Instead of target. certificate_name: The certificate. cer_path: The public half. pvk_path: The private key. password: The key's password. dry_run: Plan only: change nothing.
|
| restore-logB | dbabrain common.cli restore-log: One restore step on one engine.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): db_type (required): The engine. target: The instance - an input_remote_target. sqlcmd: SQL Server: run the step with sqlcmd where the server is instead of a driver from here - the run-sqlcmd request less its sql (instance, sqlcmd_path, username, password, timeouts, via, host). One file per call; the ans... backup_path: The backup. backup_paths: Several, in order. database_name: One database. move: SQL Server: file moves. move_files: SQL Server full: {data, log} - where the two files go; the logical names are read on the server (RESTORE FILELISTONLY), and the database goes SINGLE_USER first. relocate: SQL Server full onto another server: every file RESTORE FILELISTONLY names goes to the target's default data / log folder - or data_dir / log_dir - as _; {} for both defaults; the database goes SI... replace: SQL Server: WITH REPLACE. overwrite_existing: Whether the step may replace what the target holds; without true it stops first (0.26.0, G2.10; every engine and any state since 0.39.0). SQL Server full: a database of that name in any state raises before the batch t... stats: SQL Server: progress every n percent. with_recovery: Bring it online after. stopat: A point in time. host: Oracle / PostgreSQL: the host. backup_location: Oracle: where the pieces are. encryption_password: Oracle: the backup's password. mode: Oracle: the RMAN mode. oracle_sid: Oracle: the SID. bin_dir: PostgreSQL: the binaries. data_dir: PostgreSQL: the data directory. run_as: PostgreSQL: the OS user. staging_dir: PostgreSQL: where pieces are staged. wal_dir: PostgreSQL: the WAL archive. dry_run: Plan only: change nothing. timeout_seconds: How long to wait. recovery_timeout_seconds: PostgreSQL into a container, with wal_dir: how long to wait for recovery to end (default 1800). A container that stops or restarts ends the wait at once.
|
| restore-metadataB | dbabrain common.cli restore-metadata: Server-level metadata files to replay after a restore.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): |
| rotate-passwordA | dbabrain common.cli rotate-password: Which secret refs to rotate, and how.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): refs: The refs. match: Or a pattern. allow_name_host: Removed in 0.26.0 (owner decision G3.4): a request carrying true is refused. A password is changed only on the instance db_instances.json names for its ref - never on a host taken from the ref's name. host_overrides: {ref: host}. password_length: How long a new password is. passwords: {ref: new value}, instead of generating. plaintext_store: Where a plaintext copy goes. dry_run: Plan only: change nothing. timeout_seconds: How long to wait.
|
| run-cmdA | dbabrain common.cli run-cmd: One shell command on a host.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: A label for the answer - the server_id. Nothing is looked up by it: common.cli reads no configuration (rules R09). access: The host login, complete: an inline cmd_access - method (ssh|winrm), host, port, username, auth_type, key_file or password - with the machine's platform and runtime facts. The app that calls fills it from its own data... platform: windows | linux, when access does not say. profile: What the target is: os, os_major, runtime. command: The command. script: Or a script. sudo: Through sudo. timeout_seconds: How long to wait. format: json | txt | raw. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence.
|
| run-sqlB | dbabrain common.cli run-sql: A statement to run on one target, and how.
Runs with the rights of the login this node stores for the server (users.json: the instance's default_credential_name, or credential_name): what that login may do, this may do - DML and DDL included. The statement is checked to be one SELECT and the batch is rolled back, but the check reads text and does not bound what the login can do; a login with read rights only is what keeps it to reading. The SQL is the target engine's: SQL Server T-SQL https://learn.microsoft.com/sql/t-sql/language-reference, PostgreSQL https://www.postgresql.org/docs/current/sql-commands.html, Oracle https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/, MySQL https://dev.mysql.com/doc/refman/8.4/en/sql-statements.html.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: A label for the answer - the server_id. Nothing is looked up by it: common.cli reads no configuration (rules R09). sql_text: The SQL. sql_file: Or a file of it. database_name: One database. sql_access: How to reach the SQL engine, overriding the connection's own sql_access block (an 8i bridge on this machine). secrets: {ref: value} for exactly the secret refs the connection's sql_access names (an 8i bridge's signing secret) - never the whole store. The app that calls fills it from its own data/ (dbabrain.lib.data_sources.request_fil... connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... profile: What the target is. driver: Which driver. oracle_client_mode: thin | thick. params: Bound parameters. define: Oracle substitution variables. defines: The same, plural. prelude: SQL text prepended to each batch. named_params: Values by name, bound where an Oracle or PostgreSQL statement says :name. autocommit: Commit each statement. commit: Commit at the end. capture: Which result sets to keep: first (the default) or all. max_rows: At most this many rows. max_result_sets: At most this many result sets. connect_timeout_seconds: How long connecting may take. timeout_seconds: How long to wait. output_path: Write the rows to a file. format: json (default) | txt.
|
| run-sql-writeA | dbabrain common.cli run-sql (writing): A statement to run on one target, and how.
The SQL is the target engine's: SQL Server T-SQL https://learn.microsoft.com/sql/t-sql/language-reference, PostgreSQL https://www.postgresql.org/docs/current/sql-commands.html, Oracle https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/, MySQL https://dev.mysql.com/doc/refman/8.4/en/sql-statements.html.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: A label for the answer - the server_id. Nothing is looked up by it: common.cli reads no configuration (rules R09). sql_text: The SQL. sql_file: Or a file of it. database_name: One database. sql_access: How to reach the SQL engine, overriding the connection's own sql_access block (an 8i bridge on this machine). secrets: {ref: value} for exactly the secret refs the connection's sql_access names (an 8i bridge's signing secret) - never the whole store. The app that calls fills it from its own data/ (dbabrain.lib.data_sources.request_fil... connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... profile: What the target is. driver: Which driver. oracle_client_mode: thin | thick. params: Bound parameters. define: Oracle substitution variables. defines: The same, plural. prelude: SQL text prepended to each batch. named_params: Values by name, bound where an Oracle or PostgreSQL statement says :name. autocommit: Commit each statement. commit: Commit at the end. capture: Which result sets to keep: first (the default) or all. max_rows: At most this many rows. max_result_sets: At most this many result sets. connect_timeout_seconds: How long connecting may take. timeout_seconds: How long to wait. output_path: Write the rows to a file. format: json (default) | txt.
Runs SQL that changes data; what it changed is kept only when the request says commit (or autocommit) true - otherwise rolled back. The SQL is the target engine's: SQL Server T-SQL https://learn.microsoft.com/sql/t-sql/language-reference, PostgreSQL https://www.postgresql.org/docs/current/sql-commands.html, Oracle https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/, MySQL https://dev.mysql.com/doc/refman/8.4/en/sql-statements.html.
|
| run-sqlcmdA | dbabrain common.cli run-sqlcmd: One sqlcmd batch, and where to run it.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): sql (required): The batch. instance (required): The -S sqlcmd connects to, as the host running it sees it. sqlcmd_path: The sqlcmd to run (default sqlcmd). container: The container the SQL Server runs in: its own sqlcmd runs the batch (docker exec), for a host with no sqlcmd of its own. ssh or local only. username: A SQL login. With password; give neither for -E. password: Its RESOLVED value. stdin only. login_timeout_seconds: sqlcmd -l (default 30). query_timeout_seconds: sqlcmd -t; 0 = none. timeout_seconds: The whole run; 0 = none. Past it, the answer says timed_out. via: local | ssh (a Linux host) | winrm (a Windows host, through a local Invoke-Command). host: ssh / winrm: host, port, username, a RESOLVED password or key_file, open_timeout_seconds.
|
| seal-ssh-keyA | dbabrain common.cli seal-ssh-key: One SSH private key to seal (or generate and seal) by its full path, and the ref for its passphrase.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): key_file (required): The key's FULL path - this command reads no configuration (rules R09). passphrase_ref (required): The secret ref its random passphrase is stored under; one already holding another value is refused. generate: Make a new ed25519 pair at key_file (and its .pub) instead of sealing one; never over a file. comment: The .pub's comment when generating (default: the file's name). also_plaintext: Also write the ref into secrets/secret_text.json, which deploy regenerates the store from (a master).
|
| self-statusA | dbabrain common.cli self-status: What this installation is - and, stated by the caller, when each app last ran.
Request fields (pass them as request): format: json (default) | txt. last_runs: {app code: {status, started_at}} - the newest run of each app command in the last day. The store is not opened here (rules R09): the caller reads it (/spbot_self_status does). Absent, the column says not stated. store_error: Why the caller could not read the last runs; shown in their place.
|
| send-fileC | dbabrain common.cli send-file: A file fetched, sent, packed or relayed over the host's own access.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: A label for the answer - the server_id. Nothing is looked up by it: common.cli reads no configuration (rules R09). server_id: The same label, when not in target. access: The host login, complete: an inline cmd_access - method (ssh|winrm), host, port, username, auth_type, key_file or password - with the machine's platform and runtime facts. The app that calls fills it from its own data... remote_path: fetch/send: the file on the host. local_path: fetch/send: the file here. overwrite: Replace an existing file. make_dirs: Create missing folders. files: pack-files: the files. folder: pack-files: or a folder. include: pack-files: patterns within it. format: pack-files: tar | tar.gz | zip. archive_path: pack-files: the archive. checksum_files: pack-files: hash each member. source: relay-file: {access, target, path} - each side states its own login. destination: relay-file: {access, target, path}.
|
| shrink-logB | dbabrain common.cli shrink-log: A break-glass SQL Server action: shrink a log, kill a session, start or disable a job.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. server_id: The instance, when not in target. sql_access: How to reach the SQL engine, overriding the instance's block. database_name: One database. size_mb: shrink-log: the size to shrink to. spid: kill-spid: the session. report_rollback: kill-spid: report the rollback's progress. job_name: start-job / disable-job: the Agent job. override: Accept a blocking gate. timeout_seconds: How long to wait. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| smb-credentialB | dbabrain common.cli smb-credential: A Windows share and the login to it - what to list, fetch, delete, or store the login for.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: The machine sharing it: //host/share. Every command but smb-credential. share: The share's name on that host. username: The login. A domain before it (DOMAIN, then a backslash, then the user) is split off, as Windows writes it. The caller resolves it - common.cli reads no configuration. password: The login's password. Never on a command line: smbclient reads it from a file this command writes 0600 and deletes. domain: The login's domain, when not part of username. backend: smbclient | unc. Default: unc on Windows (the share's own path, after cmdkey), smbclient elsewhere. timeout_seconds: The whole call. Default 600 for a listing or a delete, 3600 for one file. path: smb-list: the folder under the share to list; empty = the share's root. recurse: smb-list: into subfolders (default true). suffixes: smb-list: only file names ending in one of these, case-insensitive (e.g. [".bak", ".trn"]). remote_path: smb-get: the file under the share, backslash- or slash-separated. local_path: smb-get: the file to write on this node; its folder is created. paths: smb-delete: the ONE file to delete, under the share - a list of exactly one path, never a pattern or a folder; two or more are refused. force: smb-delete: must be true - a share has no host to hash a file on, so this is the forced delete of one stray file. target: smb-credential: the host whose UNC paths the stored login opens.
|
| smb-deleteB | dbabrain common.cli smb-delete: A Windows share and the login to it - what to list, fetch, delete, or store the login for.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: The machine sharing it: //host/share. Every command but smb-credential. share: The share's name on that host. username: The login. A domain before it (DOMAIN, then a backslash, then the user) is split off, as Windows writes it. The caller resolves it - common.cli reads no configuration. password: The login's password. Never on a command line: smbclient reads it from a file this command writes 0600 and deletes. domain: The login's domain, when not part of username. backend: smbclient | unc. Default: unc on Windows (the share's own path, after cmdkey), smbclient elsewhere. timeout_seconds: The whole call. Default 600 for a listing or a delete, 3600 for one file. path: smb-list: the folder under the share to list; empty = the share's root. recurse: smb-list: into subfolders (default true). suffixes: smb-list: only file names ending in one of these, case-insensitive (e.g. [".bak", ".trn"]). remote_path: smb-get: the file under the share, backslash- or slash-separated. local_path: smb-get: the file to write on this node; its folder is created. paths: smb-delete: the ONE file to delete, under the share - a list of exactly one path, never a pattern or a folder; two or more are refused. force: smb-delete: must be true - a share has no host to hash a file on, so this is the forced delete of one stray file. target: smb-credential: the host whose UNC paths the stored login opens.
|
| smb-getA | dbabrain common.cli smb-get: A Windows share and the login to it - what to list, fetch, delete, or store the login for.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): host: The machine sharing it: //host/share. Every command but smb-credential. share: The share's name on that host. username: The login. A domain before it (DOMAIN, then a backslash, then the user) is split off, as Windows writes it. The caller resolves it - common.cli reads no configuration. password: The login's password. Never on a command line: smbclient reads it from a file this command writes 0600 and deletes. domain: The login's domain, when not part of username. backend: smbclient | unc. Default: unc on Windows (the share's own path, after cmdkey), smbclient elsewhere. timeout_seconds: The whole call. Default 600 for a listing or a delete, 3600 for one file. path: smb-list: the folder under the share to list; empty = the share's root. recurse: smb-list: into subfolders (default true). suffixes: smb-list: only file names ending in one of these, case-insensitive (e.g. [".bak", ".trn"]). remote_path: smb-get: the file under the share, backslash- or slash-separated. local_path: smb-get: the file to write on this node; its folder is created. paths: smb-delete: the ONE file to delete, under the share - a list of exactly one path, never a pattern or a folder; two or more are refused. force: smb-delete: must be true - a share has no host to hash a file on, so this is the forced delete of one stray file. target: smb-credential: the host whose UNC paths the stored login opens.
|
| smb-listA | dbabrain common.cli smb-list: A Windows share and the login to it - what to list, fetch, delete, or store the login for.
Request fields (pass them as request): host: The machine sharing it: //host/share. Every command but smb-credential. share: The share's name on that host. username: The login. A domain before it (DOMAIN, then a backslash, then the user) is split off, as Windows writes it. The caller resolves it - common.cli reads no configuration. password: The login's password. Never on a command line: smbclient reads it from a file this command writes 0600 and deletes. domain: The login's domain, when not part of username. backend: smbclient | unc. Default: unc on Windows (the share's own path, after cmdkey), smbclient elsewhere. timeout_seconds: The whole call. Default 600 for a listing or a delete, 3600 for one file. path: smb-list: the folder under the share to list; empty = the share's root. recurse: smb-list: into subfolders (default true). suffixes: smb-list: only file names ending in one of these, case-insensitive (e.g. [".bak", ".trn"]). remote_path: smb-get: the file under the share, backslash- or slash-separated. local_path: smb-get: the file to write on this node; its folder is created. paths: smb-delete: the ONE file to delete, under the share - a list of exactly one path, never a pattern or a folder; two or more are refused. force: smb-delete: must be true - a share has no host to hash a file on, so this is the forced delete of one stray file. target: smb-credential: the host whose UNC paths the stored login opens.
|
| sql-command-addB | dbabrain common.cli sql-command-add: A SQL task's WHAT: its name and its script.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): display_name (required): What a person reads. db_type (required): sqlserver | oracle | postgresql. sql_id: The id; the next free one when absent. sql_code: Its code. script_type: single | array | folder. script_path: The script. script_paths: array: the scripts. final_script_paths: Run once at the end. sql_text: Or the SQL itself. version_from: Oldest product version. version_to: Newest product version. parameters: Its parameters. autocommit: Commit each statement. progress_per_file: Report each file. input_type: What input it takes. input: That input's settings. active: Switched on. note: Why it exists. replace: Overwrite this sql_id.
|
| sql-target-addC | dbabrain common.cli sql-target-add: A SQL task's WHERE and WHEN.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): sql_id (required): The task. server_id (required): The machine. target_no: The target number. instance_name: The instance. service_name: A label. database_name: One database. credential_name: Which login in users.json; default: the instance's own. sql_access: How to reach the SQL engine, overriding the instance's block. time_window: When it runs. manual_only: Only when asked for. notify: Who hears about it. logging_on_run: The flat form: send a message when each run starts, to logging_chat. A boolean - the parser reads it as one; the whole block goes under notify. Described as an object until 0.27.0, so R49 refused the form the command'... alert_on_error: The flat form: send a message when a run fails, to error_chat. A boolean - the parser reads it as one; the whole block goes under notify. Described as an object until 0.27.0, so R49 refused the form the command's own ... logging_chat: Progress chat level. logging_chat_id: Or a chat id. error_chat: Failure chat level. error_chat_id: Or a chat id. output: What it does with its result set. output_chat: Where the result goes. output_chat_id: Or a chat id. output_max_rows: Rows sent to a chat. active: Switched on. note: Why it exists. replace: Overwrite this target.
|
| sqlserver-apply-cuB | dbabrain common.cli sqlserver-apply-cu: A cumulative update checked, applied or verified on one instance.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. instance_name: The instance on the host. kb: The update's KB. installer: The installer's path. installer_sha256: Its expected checksum. skip_hash: Do not check it. expected_build: The build it should end on. registry_key: Where the instance's build is read. setup_account: Who runs setup. window: The maintenance window. ignore_window: Run outside it. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... access: The host login, complete: an inline cmd_access - method (ssh|winrm), host, port, username, auth_type, key_file or password - with the machine's platform and runtime facts. The app that calls fills it from its own data... policy: The maintenance policy that times this host operation: the node's maintenance_policy.json defaults with this server's own values over them. {} means the built-in defaults. The app that calls fills it from its own data... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| sqlserver-export-instanceB | dbabrain common.cli sqlserver-export-instance: An instance's server-level metadata exported, replayed or verified.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. output_dir: export: where the bundle goes. bundle_dir: replay/verify: the bundle. include: Which artifacts. phase: pre-database | post-database | all. overrides: Per-artifact choices. secret_prefix: The ref prefix for secrets. on_missing_secret: fail | skip. on_unsupported: fail | skip. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... policy: The content of sqlserver_instance_policy.json - which server settings are portable between instances. Required: an export or a replay with no policy is refused. The app that calls fills it from its own data/ (dbabrain... secrets: {ref: value} for exactly the secret refs the bundle's manifest lists (secret_refs). A ref missing here is reported and the replay fails closed. The app that calls fills it from its own data/ (dbabrain.lib.data_sources... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| sqlserver-precheckC | dbabrain common.cli sqlserver-precheck: A cumulative update checked, applied or verified on one instance.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. instance_name: The instance on the host. kb: The update's KB. installer: The installer's path. installer_sha256: Its expected checksum. skip_hash: Do not check it. expected_build: The build it should end on. registry_key: Where the instance's build is read. setup_account: Who runs setup. window: The maintenance window. ignore_window: Run outside it. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... access: The host login, complete: an inline cmd_access - method (ssh|winrm), host, port, username, auth_type, key_file or password - with the machine's platform and runtime facts. The app that calls fills it from its own data... policy: The maintenance policy that times this host operation: the node's maintenance_policy.json defaults with this server's own values over them. {} means the built-in defaults. The app that calls fills it from its own data... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| sqlserver-replay-instanceC | dbabrain common.cli sqlserver-replay-instance: An instance's server-level metadata exported, replayed or verified.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. output_dir: export: where the bundle goes. bundle_dir: replay/verify: the bundle. include: Which artifacts. phase: pre-database | post-database | all. overrides: Per-artifact choices. secret_prefix: The ref prefix for secrets. on_missing_secret: fail | skip. on_unsupported: fail | skip. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... policy: The content of sqlserver_instance_policy.json - which server settings are portable between instances. Required: an export or a replay with no policy is refused. The app that calls fills it from its own data/ (dbabrain... secrets: {ref: value} for exactly the secret refs the bundle's manifest lists (secret_refs). A ref missing here is reported and the replay fails closed. The app that calls fills it from its own data/ (dbabrain.lib.data_sources... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| sqlserver-verify-buildC | dbabrain common.cli sqlserver-verify-build: A cumulative update checked, applied or verified on one instance.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. instance_name: The instance on the host. kb: The update's KB. installer: The installer's path. installer_sha256: Its expected checksum. skip_hash: Do not check it. expected_build: The build it should end on. registry_key: Where the instance's build is read. setup_account: Who runs setup. window: The maintenance window. ignore_window: Run outside it. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... access: The host login, complete: an inline cmd_access - method (ssh|winrm), host, port, username, auth_type, key_file or password - with the machine's platform and runtime facts. The app that calls fills it from its own data... policy: The maintenance policy that times this host operation: the node's maintenance_policy.json defaults with this server's own values over them. {} means the built-in defaults. The app that calls fills it from its own data... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| sqlserver-verify-instanceC | dbabrain common.cli sqlserver-verify-instance: An instance's server-level metadata exported, replayed or verified.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. output_dir: export: where the bundle goes. bundle_dir: replay/verify: the bundle. include: Which artifacts. phase: pre-database | post-database | all. overrides: Per-artifact choices. secret_prefix: The ref prefix for secrets. on_missing_secret: fail | skip. on_unsupported: fail | skip. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... policy: The content of sqlserver_instance_policy.json - which server settings are portable between instances. Required: an export or a replay with no policy is refused. The app that calls fills it from its own data/ (dbabrain... secrets: {ref: value} for exactly the secret refs the bundle's manifest lists (secret_refs). A ref missing here is reported and the replay fails closed. The app that calls fills it from its own data/ (dbabrain.lib.data_sources... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| standardize-field-namesC | dbabrain common.cli standardize-field-names: Which folder to move to this version's shapes, and whether to write.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): data_dir: Another data/ folder to read. dry_run: Plan only: change nothing. file: standardize-field-names: one file. steps: upgrade-config: some steps.
|
| start-jobC | dbabrain common.cli start-job: A break-glass SQL Server action: shrink a log, kill a session, start or disable a job.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. server_id: The instance, when not in target. sql_access: How to reach the SQL engine, overriding the instance's block. database_name: One database. size_mb: shrink-log: the size to shrink to. spid: kill-spid: the session. report_rollback: kill-spid: report the rollback's progress. job_name: start-job / disable-job: the Agent job. override: Accept a blocking gate. timeout_seconds: How long to wait. dry_run: Plan only: change nothing. confirm: The payload declares the operator agreed. assume_yes: Unattended: take the typed yes as given. authorized_by: Who approved it, for example {"channel": "telegram"}. reason: Why, for the evidence. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an... rules: What the operation costs to confirm: {level, confirmations, challenge, effects} - the node's own emergency_operations.json entry for it. Absent, the ladder the package ships prices it; malformed, it is refused rather ...
|
| table-infoB | dbabrain common.cli table-info: One database object or the server's activity read: a table, a definition, what runs now, a plan.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. credential_name: Which login in users.json; default: the instance's own. sql_access: How to reach the SQL engine - the inventory's (the 8i bridge). database_name: The database to read in; SQL Server: else master. object: table-info / object-source: the object, name, schema.name or [schema].[name]. view: db-activity: requests (default) | blocking | waits | top_queries. sql_text: query-plan: the one statement to compile - never run. max_rows: db-activity: rows at most, 1 to 1000 (default 50). timeout_seconds: How long to wait. connection: The database login, complete: db_type, host, port, username, password. The app that calls fills it from its own data/ (dbabrain.lib.data_sources.request_fill); common.cli reads no configuration (rules R09).
|
| trace-sessionB | dbabrain common.cli trace-session: Which sessions to trace on one instance.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Request fields (pass them as request): target: The machine or instance: a server_id, or <db_type> <ip>[:port]. session_id: One session. blocking_only: Only blockers. min_tran_seconds: Only transactions open this long. key: The secret-store passphrase, when not in the environment. key_base64: The same, base64. connection: The database login, complete: db_type, host, port, username, password - and, where they apply, database, instance_name, service_name, sqlserver_driver, sqlserver_tls_verify and sql_access (the 8i bridge); server_id an...
|
| upgrade-configB | dbabrain common.cli upgrade-config: Which folder to move to this version's shapes, and whether to write.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request): data_dir: Another data/ folder to read. dry_run: Plan only: change nothing. file: standardize-field-names: one file. steps: upgrade-config: some steps.
|
| verify-restoreB | dbabrain common.cli verify-restore: Which restored databases to ask about, and where.
Request fields (pass them as request): db_type (required): The engine. target: The instance. host: Oracle / PostgreSQL: the host block the check runs on - {host, port, username, password|key_file, runtime}. port: Its port. username: Who asks. database_names: The databases, by the names they were restored under. database_name: One database. oracle_sid: Oracle: the SID. timeout_seconds: How long to wait. consistency: Also run the engine's own consistency check (0.35.0, 1.251): DBCC CHECKDB on each SQL Server database, pg_amcheck --all on PostgreSQL, RMAN VALIDATE CHECK LOGICAL and v$database_block_corruption on Oracle. restore-by-... consistency_timeout_seconds: With consistency: how long the check may run - kept on the host for PostgreSQL (timeout), the transport waits 60 s more; RMAN VALIDATE likewise. restore-by-id sets it from the entry's checkdb_timeout_seconds. consistency_jobs: With consistency on PostgreSQL: pg_amcheck --jobs. restore-by-id sets it from the entry's checkdb_jobs.
|
| store_schemaA | dbabrain's runtime store: every table and its columns, or one table's columns with their types (table). |
| store_queryA | One read-only SELECT on dbabrain's runtime store (sql), always rolled back; max_rows up to the node's cap. Tables: store_schema. |