### Local Development Setup for xyOps Source: https://github.com/pixlcore/xyops/blob/main/README.md Steps to set up a local development environment for xyOps, including cloning the repository, installing dependencies, building the project, and starting the debug mode. ```sh git clone https://github.com/pixlcore/xyops.git cd xyops npm install node bin/build.js dev echo '{ "secret_key": "test" }' > conf/overrides.json bin/debug.sh ``` -------------------------------- ### Manual xyOps Installation Steps Source: https://github.com/pixlcore/xyops/blob/main/docs/hosting.md Manually install xyOps by downloading the archive, installing dependencies, building the distribution, and starting the service. Replace 'v1.0.0' with the desired version. ```sh mkdir -p /opt/xyops && cd /opt/xyops curl -L https://github.com/pixlcore/xyops/archive/v1.0.0.tar.gz | tar zxvf - --strip-components 1 npm install node bin/build.js dist bin/control.sh start ``` -------------------------------- ### Install Plugin with npx Source: https://github.com/pixlcore/xyops/blob/main/docs/sso.md Run the plugin directly using npx for quick setup or testing. ```json "command": "npx -y @pixlcore/xyplug-sso-oidc@1.0.0" ``` -------------------------------- ### Docker Worker Installation Command with API Key Source: https://github.com/pixlcore/xyops/blob/main/docs/servers.md This is an example of the XYOPS_setup URL with a permanent API Key replacing the temporary auth token. ```sh http://YOUR_XYOPS_SERVER:5522/api/app/satellite/config?t=YOUR_API_KEY_HERE ``` -------------------------------- ### Example Request for Bulk Search Export Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md This example demonstrates how to construct a GET request for the bulk_search_export API, specifying the index, query, columns, sorting, format, and compression. ```http GET /api/app/bulk_search_export/v1?index=jobs&query=tags:_error&columns=id,event,category,plugin,completed,code&sort_by=completed&sort_dir=-1&format=csv&compress=1 ``` -------------------------------- ### Example Create Plugin Response Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md This is an example response after successfully creating a plugin. It includes the full plugin object with auto-generated fields. ```JSON { "code": 0, "plugin": { /* full plugin object including auto-generated fields */ } } ``` -------------------------------- ### Get All Categories Response Example Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example response from the get_categories API, including a list of categories and summary metadata. ```JSON { "code": 0, "rows": [ { "id": "general", "title": "General", "enabled": true, "sort_order": 0, "username": "admin", "modified": 1754365754, "created": 1754365754, "notes": "For events that don't fit anywhere else.", "color": "plain", "icon": "", "limits": [], "actions": [], "revision": 1 } ], "list": { "length": 1 } } ``` -------------------------------- ### Example Server Process Details Source: https://github.com/pixlcore/xyops/blob/main/docs/data.md An example of a single process object found within the 'list' array of the process monitoring data. ```json { "age": 17294, "class": "Other", "command": "/usr/bin/redis-server *:6379", "cpu": 0.02, "group": "redis", "mem": 0, "memRss": 3227648, "memVsz": 1122566144, "nice": 0, "parentPid": 1, "pid": 272, "priority": 19, "started": 1754854907, "state": "Sleeping", "threads": 5, "time": 42, "tty": "?", "user": "redis" } ``` -------------------------------- ### Satellite Token Response Example Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example JSON response containing the bootstrap token, base URL, image, and version for satellite setup. ```json { "code": 0, "token": "tme4wxyz9ab", "base_url": "https://xyops01.example.com", "image": "ghcr.io/pixlcore/xysat", "version": "latest" } ``` -------------------------------- ### Start Docker Compose Source: https://github.com/pixlcore/xyops/blob/main/docs/tailscale.md Run this command to start all project services in the background using Docker Compose. ```sh docker compose up -d ``` -------------------------------- ### Example Server Snapshot Structure Source: https://github.com/pixlcore/xyops/blob/main/docs/data.md A partial example of a server snapshot in JSON format, showing key metadata and data sections. ```json { "alerts": [], "data": {}, "date": 1754793721, "groups": [ "main" ], "hostname": "centos-9-arm", "id": "snme52vvah17", "ip": "::ffff:10.1.10.241", "jobs": [], "quickmon": [], "server": "sorbstack01", "source": "user", "type": "server", "username": "admin", "version": "1.0" } ``` -------------------------------- ### Example API URL Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md An example of a complete API URL for the search_jobs function. ```text http://sample.west.xyops.io/api/app/search_jobs/v1 ``` -------------------------------- ### xyOps Wire Protocol - Request Example Source: https://github.com/pixlcore/xyops/blob/main/docs/xywp.md Example of a request message to launch a job (Event Plugin). ```APIDOC ## Request Example Here is an example request to launch a job (Event Plugin): ```json { "xy": 1, "type": "event", "id": "jmhzaot10tm", "event": "emi11ejdlde", "plugin": "pmi11dqsxcy", "server": "smf4j79snhe", "now": 1763256572.024 /* See Job data structure for more */ } ``` ``` -------------------------------- ### Example Response for create_api_key Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md This is an example response after creating an API Key. It includes the API Key metadata and the 'plain_key' containing the secret. ```JSON { "code": 0, "api_key": { /* metadata */ }, "plain_key": "API_KEY_HERE" } ``` -------------------------------- ### Example Response for get_api_key Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md This is an example of a successful response when fetching an API Key. It includes the API Key object with its details. ```JSON { "code": 0, "api_key": { "id": "k1", "title": "My App", "key": "rPEu2GRpK3TPgVnmSFVPFTT9", "active": 1 } } ``` -------------------------------- ### Install macOS Command-Line Tools Source: https://github.com/pixlcore/xyops/blob/main/docs/dev.md Instructions for installing command-line tools on macOS after downloading Xcode, which are necessary for compiling binary dependencies. ```sh xcode-select --install ``` -------------------------------- ### Example Response for create_group Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example JSON response upon successful group creation. Includes the newly created 'group' object. ```json { "code": 0, "group": { /* full group object including auto-generated fields */ } } ``` -------------------------------- ### Master Command Request Example Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example JSON payload for sending a restart command to a conductor. ```json { "host": "xyops02.internal.example.com", "commands": ["restart"] } ``` -------------------------------- ### Incoming Trusted Headers Example Source: https://github.com/pixlcore/xyops/blob/main/docs/sso.md An example of incoming trusted headers from an identity provider, showing user, groups, and email. ```json { "x-forwarded-email": "jhuckaby@example.com", "x-forwarded-groups": "pixlcore,pixlcore:owners", "x-forwarded-user": "jhuckaby" } ``` -------------------------------- ### Example Request for create_group Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example JSON payload for creating a new group, including required fields like 'title' and 'hostname_match'. ```json { "title": "Main Group", "hostname_match": ".+", "notes": "Primary workers" } ``` -------------------------------- ### Install xyOps using a Script Source: https://github.com/pixlcore/xyops/blob/main/docs/hosting.md Installs the latest stable release of xyOps and its dependencies by piping a script to Node.js. Requires root privileges. ```sh curl -s https://raw.githubusercontent.com/pixlcore/xyops/main/bin/install.js | node ``` -------------------------------- ### Start xyOps Service Source: https://github.com/pixlcore/xyops/blob/main/docs/cli.md Use this command to start the xyOps service in daemon mode. Ensure you have the correct path to the control script. ```bash /opt/xyops/bin/control.sh start ``` -------------------------------- ### Access Authentik Initial Setup URL Source: https://github.com/pixlcore/xyops/blob/main/docs/sso.md Open the initial setup URL in your browser to configure Authentik. This URL assumes Authentik is accessible via 'auth.yourcompany.com'. ```bash http://auth.yourcompany.com/if/flow/initial-setup/ ``` -------------------------------- ### Get Single Category Response Example Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example response from the get_category API, containing the requested category object. ```JSON { "code": 0, "category": { "id": "general", "title": "General", "enabled": true, "sort_order": 0, "username": "admin", "modified": 1754365754, "created": 1754365754, "notes": "For events that don't fit anywhere else.", "color": "plain", "icon": "", "limits": [], "actions": [], "revision": 1 } } ``` -------------------------------- ### Activity Log Query Examples Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Examples demonstrating how to format the 'query' parameter for searching activity logs. Supports simple and PxQL formats for filtering by action, keywords, and date ranges. ```text action:job_error action:alert_new|alert_cleared keywords:admin date:>=2025-01-01 date:<2026-01-01 date:>=today ``` -------------------------------- ### Get Single Category Request Example Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example JSON payload for the get_category API, specifying the ID of the category to fetch. ```JSON { "id": "general" } ``` -------------------------------- ### Echo API Example Response (GET) Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md This JSON object shows a truncated example response from the echo endpoint when using a GET request with a sleep parameter. It includes details about the request method, URI, IP addresses, headers, cookies, and parameters. ```json { "method": "GET", "uri": "/api/app/echo/v1?sleep=250", "ips": ["203.0.113.10"], "headers": { "host": "example.xyops.io", "user-agent": "curl/8.4.0" }, "cookies": {}, "params": { "sleep": 250 }, "files": {} } ``` -------------------------------- ### Example Plugin Configuration Source: https://github.com/pixlcore/xyops/blob/main/docs/data.md This JSON object defines a sample plugin, including its ID, title, enabled status, command, user, type, and parameters. It demonstrates how to configure script execution and user interaction elements. ```json { "id": "shellplug", "title": "Shell Script", "enabled": 1, "command": "[shell-plugin]", "username": "admin", "type": "event", "modified": 1754365754, "created": 1754365754, "params": [ { "id": "script", "type": "code", "title": "Script Source", "value": "#!/bin/sh\n\n# Enter your shell script code here", "locked": true }, { "id": "annotate", "type": "checkbox", "title": "Add Date/Time Stamps to Log", "value": false }, { "id": "json", "type": "checkbox", "title": "Interpret JSON in Output", "value": false } ], "revision": 1 } ``` -------------------------------- ### JobWorkflow State Example Source: https://github.com/pixlcore/xyops/blob/main/docs/data.md An example of the 'state' property within a JobWorkflow object, showing the execution start and completion times for different nodes. ```json { "n1b47xt7": { "started": 1762288805.097, "completed": 1762288805.102 }, "n24wos41": { "started": 1762288805.097 }, "ns3n5uyn": { "started": 1762288811.225 } } ``` -------------------------------- ### Application Log Examples Source: https://github.com/pixlcore/xyops/blob/main/docs/logging.md Sample entries from various application-specific log files. ```text [1763841931.973][2025-11-22 12:05:31][joemax.lan][92938][Action][debug][8][Running job actions for condition: complete][{"job_id":"jmiapxwar79"}] ``` ```text [1763880095.55][2025-11-22 22:41:35][joemax.lan][10341][API][debug][6][Handling API request: GET /api/app/get_server?id=smf4j79snhe&cachebust=1763880046.493][] ``` ```text [1763880034.062][2025-11-22 22:40:34][joemax.lan][10341][Comm][debug][6][User socket has authenticated successfully: wsmibcmostgu][{"username":"admin"}] ``` ```text [1763879905.013][2025-11-22 22:38:25][joemax.lan][10341][Debug][debug][3][Debug service listening for base URI: /internal/debug][] ``` ```text [1763879534.953][2025-11-22 22:32:14][joemax.lan][10176][Storage][error][rollback][Aborting transaction: 16][{"path":"timeline/smf4j79snhe/hourly","actions":0}] ``` ```text [1763879912.74][2025-11-22 22:38:32][joemax.lan][10341][Filesystem][debug][9][Fetching Binary Stream: users/admin/avatar/64.png][data/users/admin/avatar/64.png] ``` ```text [1763879904.984][2025-11-22 22:38:24][joemax.lan][10341][Hybrid][debug][2][Setting up hybrid engine][{"docEngine":"SQLite","binaryEngine":"Filesystem"}] ``` ```text [1763879516.523][2025-11-22 22:31:56][joemax.lan][10176][Job][debug][5][Starting new internal job: imibcblgrjg][{"title":"Worker server upgrade","type":"maint","username":"admin","params":{"targets":["main"],"release":"latest","stagger":30},"stats":{"servers":0,"skipped":0},"details":"","id":"imibcblgrjg","started":1763879516.523,"progress":0}] ``` ```text [1763831742.113][2025-11-22 09:15:42][joemax.lan][92938][Maint][debug][6][A new day dawns, resetting daily stats.][] ``` -------------------------------- ### Example Response for get_quickmon_data Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Illustrates the structure of the response from the get_quickmon_data endpoint, including a 'servers' object keyed by server ID. ```json { "code": 0, "servers": { "s12345abcde": [ /* QuickMon entries */ ] } } ``` -------------------------------- ### Interval Trigger Example Source: https://github.com/pixlcore/xyops/blob/main/docs/data.md This trigger runs an event starting at a specific Unix timestamp and repeats every 90 seconds thereafter. It is ideal for tasks that need to run at regular, fixed intervals after an initial start time. ```json { "type": "interval", "enabled": true, "start": 1766111340, "duration": 90 } ``` -------------------------------- ### Server Monitor Data: Commands Example Source: https://github.com/pixlcore/xyops/blob/main/docs/data.md This JSON object shows an example of the raw output from custom user commands (Monitor Plugins) on a server, keyed by plugin ID. ```json { "open_files": "1056\t0\t9223372036854775807" } ``` -------------------------------- ### Get Servers Response Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example response for fetching a snapshot of all connected worker and server instances. Returns server and master information. ```json { "code": 0, "servers": { "sorbstack01": { "id": "sorbstack01", "hostname": "centos-9-arm", "groups": ["main"], "enabled": true, "modified": 1754872218, "info": { /* see Server */ } } }, "masters": { "conductor-a": { "id": "conductor-a", "online": true, "master": true, "date": 1754800000, "version": "0.0.0", "ping": 0, "stats": { /* mem, load */ } } } } ``` -------------------------------- ### Delay Trigger Example Source: https://github.com/pixlcore/xyops/blob/main/docs/triggers.md Adds a starting delay to scheduler-launched jobs. Does not affect manual or API runs. Mutually exclusive with 'interval' and 'precision'. ```json { "type": "delay", "enabled": true, "duration": 120 } ``` -------------------------------- ### Fetch Bucket Action Configuration Source: https://github.com/pixlcore/xyops/blob/main/docs/buckets.md Configure a job to fetch bucket content at the start. Selects data and files matching a glob pattern. ```json { "enabled": true, "condition": "start", "type": "fetch", "bucket_id": "bme4wi6pg35", "bucket_sync": "data_and_files", "bucket_glob": "*.csv" } ``` -------------------------------- ### Example Role Configuration Source: https://github.com/pixlcore/xyops/blob/main/docs/data.md This JSON object demonstrates a typical role configuration, including its ID, title, enabled status, and assigned privileges. ```json { "id": "all", "title": "All Users", "enabled": true, "username": "admin", "modified": 1434125333, "created": 1434125333, "notes": "A base set of privileges for all users to enjoy.", "icon": "", "categories": [], "groups": [], "privileges": { "create_events": true, "edit_events": true, "run_jobs": true, "tag_jobs": true } } ``` -------------------------------- ### Get Buckets Response Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example response when fetching all storage bucket definitions. Includes a 'rows' array with bucket details and a 'list' object for metadata. ```json { "code": 0, "rows": [ { "id": "bme4wi6pg35", "title": "The Void", "enabled": true, "icon": "", "notes": "", "username": "admin", "modified": 1754783050, "created": 1754783023, "revision": 2 } ], "list": { "length": 1 } } ``` -------------------------------- ### Get Global State Response Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example response for fetching the conductor's in-memory state object. Includes runtime flags and internal state information. ```json { "code": 0, "state": { "scheduler": { "enabled": true }, "watches": { /* server/group watch timers */ } } } ``` -------------------------------- ### Example Plugin Response Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md This is an example of a full plugin object returned when fetching a plugin. It includes automatically generated fields like 'username', 'created', 'modified', and 'revision'. ```JSON { "code": 0, "plugin": { "id": "shellplug", "title": "Shell Script", "enabled": true, "command": "[shell-plugin]", "username": "admin", "type": "event", "modified": 1754365754, "created": 1754365754, "params": [ { "id": "script", "type": "code", "title": "Script Source", "value": "#!/bin/sh\n\n# Enter your shell script code here" }, { "id": "json", "type": "checkbox", "title": "Interpret JSON in Output", "value": false } ], "revision": 1 } } ``` -------------------------------- ### Serve xyOps with Tailscale Source: https://github.com/pixlcore/xyops/blob/main/docs/tailscale.md Start Tailscale Serve with the necessary arguments to forward application capabilities for user privileges and roles. ```sh tailscale serve --accept-app-caps=xyops.io/cap/ts 5522 ``` -------------------------------- ### Precision Trigger Example Source: https://github.com/pixlcore/xyops/blob/main/docs/triggers.md Launches jobs within the scheduled minute at specific second offsets to achieve sub-minute starts. Mutually exclusive with 'interval' and 'delay'. ```json { "type": "precision", "enabled": true, "seconds": [5, 20, 35, 50] } ``` -------------------------------- ### Open Files Monitor Plugin Output Example Source: https://github.com/pixlcore/xyops/blob/main/docs/plugins.md This shows the plain text output format of the 'open_files' Monitor Plugin script. ```text 1056 0 9223372036854775807 ``` -------------------------------- ### Storage Transaction Log Example Source: https://github.com/pixlcore/xyops/blob/main/docs/logging.md Logs abstract storage operations across engines, such as get, put, commit, and rollback. Includes transaction details and elapsed time. ```log [1763880095.554][2025-11-22 22:41:35][joemax.lan][10341][Storage][transaction][get][users/admin][{"elapsed_ms":0.573}] ``` -------------------------------- ### Display xyOps Help Source: https://github.com/pixlcore/xyops/blob/main/docs/cli.md Displays a list of all available commands and their brief descriptions, then exits. This is a good starting point for exploring command-line options. ```bash /opt/xyops/bin/control.sh help ``` -------------------------------- ### GET /api/app/stream_job/v1 Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Stream live job updates via Server-sent events. This endpoint provides real-time updates on the status and progress of a job, starting from its initiation to completion. ```APIDOC ## GET /api/app/stream_job/v1 ### Description Stream live job updates via Server-sent events. This endpoint provides real-time updates on the status and progress of a job, starting from its initiation to completion. ### Method GET ### Endpoint /api/app/stream_job/v1 ### Parameters #### Query Parameters - **id** (String) - Required - The Job.id. - **token** (String) - Optional - A special auth token used by the magic API to stream jobs for the magic landing pages. ### Response #### Success Response (200) - The response is streamed using Server-sent events. The first update includes a JSON document with the Job.id, followed by multiple updates as the job runs, with a final update upon completion. ### Response Example ``` event: start data: {} event: update data: {"xy":1,"id":"jmjgok2xeb5ufrcl","started":1766379181.011,"state":"ready","progress":0} event: update data: {"xy":1,"cpu":{"min":3.3,"max":50,"total":129.7,"count":12,"current":3.3},"mem":{"min":32239616,"max":59838464,"total":680706048,"count":12,"current":55287808},"updated":1766379192.219,"progress":0.33113333384195964} event: update data: {"xy":1,"cpu":{"min":1.8,"max":50,"total":152.85,"count":22,"current":1.8},"mem":{"min":32239616,"max":59838464,"total":1234894848,"count":22,"current":55418880},"updated":1766379202.164,"progress":0.6665666659673055} event: update data: {"xy":1,"id":"jmjgok2xeb5ufrcl","code":0,"description":"Success!","completed":1766379212.239,"elapsed":31.2260000705719,"data":{"text":"This is some sample data to pass to the next job!","hostname":"raspberrypi","pid":2954920,"random":0.54,"obj":{"foo":1,"bar":null,"bool":true},"custom":""},"files":[]} event: end data: {} ``` ``` -------------------------------- ### Start or Stop Watching a Group Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Initiates or terminates a group watch, which captures snapshots periodically. Requires the create_snapshots privilege. Supports JSON POST or GET with query parameters. ```json { "id": "main", "duration": 3600 } ``` -------------------------------- ### watch_server Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Starts or stops a watch on a server to take snapshots. Requires the 'create_snapshots' privilege and a valid user session or API Key. Supports both JSON POST and query parameter GET requests. ```APIDOC ## POST /api/app/watch_server/v1 ### Description Start or stop a watch on a server, which takes a snapshot once per minute for a specified duration. Requires the [create_snapshots](privileges.md#create_snapshots) privilege and a valid user session or API Key. Supports HTTP POST with JSON, or HTTP GET with query parameters. ### Method POST ### Endpoint /api/app/watch_server/v1 ### Parameters #### Request Body - **id** (String) - Required - The server ID to watch. - **duration** (Number) - Required - Duration in seconds. Set to `0` to cancel an existing watch. ### Request Example ```json { "id": "sorbstack01", "duration": 3600 } ``` ### Response #### Success Response (200) - **code** (Integer) - 0 indicates success. ### Response Example ```json { "code": 0 } ``` See [Snapshots](snapshots.md) for more details. ``` -------------------------------- ### Create Bucket Response Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example response after successfully creating a bucket. Includes a 'bucket' object with the details of the newly created bucket, including auto-generated properties. ```json { "code": 0, "bucket": {...} } ``` -------------------------------- ### GET /api/app/get_historical_monitor_data/v1 Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Fetches historical timeline entries for a specific server based on system ID, date, and a limit. Requires server and system IDs, a start date timestamp, and a limit for entries. ```http GET /api/app/get_historical_monitor_data/v1 ``` -------------------------------- ### Server Monitor Data: CPU Example Source: https://github.com/pixlcore/xyops/blob/main/docs/data.md This JSON object provides an example of CPU usage statistics and hardware information for a server. It includes details on load, cores, and individual CPU core performance. ```json { "avgLoad": 0, "brand": "", "cache": { "l1d": "", "l1i": "", "l2": "", "l3": "" }, "combo": "Apple", "cores": 2, "cpus": [ { "active": 0.21999999999999886, "idle": 99.78, "iowait": 0, "irq": 0, "nice": 0, "softirq": 0.01, "system": 0.06, "user": 0.13 }, { "active": 0.3199999999999932, "idle": 99.68, "iowait": 0, "irq": 0, "nice": 0, "softirq": 0, "system": 0.15, "user": 0.16 } ], "currentLoad": 0.14000000000000057, "efficiencyCores": 0, "family": "", "flags": "fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm sb dcpodp flagm2 frint", "governor": "performance", "manufacturer": "unknown", "model": "0", "performanceCores": 10, "physicalCores": 10, "processors": 1, "revision": "", "socket": "", "speed": 2, "speedMax": 2, "speedMin": 2, "stepping": "0x0", "totals": { "active": 0.14000000000000057, "idle": 99.86, "iowait": 0, "irq": 0, "nice": 0, "softirq": 0, "system": 0.05, "user": 0.08 }, "vendor": "Apple", "virtualization": false, "voltage": "" } ``` -------------------------------- ### Get Bucket Response Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example response for retrieving a specific storage bucket's definition, including its data and file list. The 'path' property in the 'files' array can be used to construct download URLs. ```json { "code": 0, "bucket": { "id": "bme4wi6pg35", "title": "The Void", "enabled": true, "icon": "", "notes": "", "username": "admin", "modified": 1754783050, "created": 1754783023, "revision": 2 }, "data": { "foo": "Hello this is a bucket" }, "files": [ { "id": "fme4wijr73h", "date": 1754783040, "filename": "test.png", "path": "files/bucket/bme4wi6pg35/bdY8zZ9nKynfFUb4xH6fA/test.png", "size": 92615, "username": "admin" } ] } ``` -------------------------------- ### GET /api/app/magic/v1/TOKEN Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Starts a job using a Magic Link, which is a unique URL with an embedded token. Parameters passed via query string or POST are forwarded as event parameters. Administrator-locked parameters cannot be overridden. ```APIDOC ## GET /api/app/magic/v1/TOKEN ### Description Start a job using a "Magic Link". This is a unique URL with an embedded cryptographic token, which is keyed to fire off a specific event via a special magic trigger. This API does not require a user session or API key -- the authentication is built right into the URL. Any parameters passed to the API, either via query string parameters or POST parameters, are passed directly into the job as event parameters. Any "administrator locked" event or plugin parameters cannot be overridden by this API. See [Magic Link Trigger](triggers.md#magic-link) for more details. ### Response #### Success Response (200) - **code** (integer) - Standard response code. - **id** (String) - The newly created Job ID. - **stream** (String) - A stream token for streaming job updates via Server-sent events. #### Response Example ```json { "code": 0, "id": "jabc123def", "stream": "38051e4e8b4edae6d705a4c8252569066f4f40d33c975bcf3c40205df87a22b9" } ``` In addition to the [Standard Response Format](#standard-response-format), this will include an `id` property containing the newly created [Job.id](data.md#job-id), and a special "stream token" in a property named `stream`. This token can be provided to the [stream_job](#stream_job) API to stream job updates via [Server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events). ``` -------------------------------- ### Configure SQLite Backups Source: https://github.com/pixlcore/xyops/blob/main/docs/hosting.md Example JSON configuration for enabling and customizing daily SQLite backups, including directory, filename pattern, compression, and retention. ```json { "SQLite": { "base_dir": "data", "filename": "sqlite.db", "pragmas": { "auto_vacuum": 0, "cache_size": -100000, "journal_mode": "WAL" }, "cache": { "enabled": true, "maxItems": 100000, "maxBytes": 104857600 }, "backups": { "enabled": true, "dir": "data/backups", "filename": "backup-[yyyy]-[mm]-[dd]-[hh]-[mi]-[ss].db", "compress": true, "keep": 7 } } } ``` -------------------------------- ### Example Plugin Definition Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md An example of a plugin definition returned by the get_plugins endpoint, showing details like ID, title, command, parameters, and metadata. ```json { "code": 0, "rows": [ { "id": "shellplug", "title": "Shell Script", "enabled": true, "command": "[shell-plugin]", "username": "admin", "type": "event", "modified": 1754365754, "created": 1754365754, "params": [ { "id": "script", "type": "code", "title": "Script Source", "value": "#!/bin/sh\n\n# Enter your shell script code here" }, { "id": "annotate", "type": "checkbox", "title": "Add Date/Time Stamps to Log", "value": false } ], "revision": 1 } ], "list": { "length": 1 } } ``` -------------------------------- ### Example Error Response Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md This is an example of the JSON response structure when an error is simulated. ```json { "code": "test", "description": "This is a test error message." } ``` -------------------------------- ### Configure Command with Global Executable Source: https://github.com/pixlcore/xyops/blob/main/docs/sso.md After global installation, configure the command to point to the installed executable. Find the correct path using 'npm bin -g'. ```json "command": "/usr/local/bin/xyplug-sso-oidc" ``` -------------------------------- ### Example Request for get_group Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Example JSON payload for fetching a group by its ID. ```json { "id": "main" } ``` -------------------------------- ### Server Search Query Examples Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Examples of query strings for the `query` parameter to filter server records by various attributes like keywords, groups, OS, CPU, and creation/modification dates. ```text web or keywords:web groups:main os_platform:linux os_distro:ubuntu os_release:22_04 os_arch:x86_64 cpu_virt:kvm cpu_brand:intel cpu_cores:8 created:>=2025-01-01 created:<2026-01-01 modified:>=today groups:main os_distro:ubuntu os_platform:linux|windows ``` -------------------------------- ### Bootstrap xySat with PowerShell Source: https://github.com/pixlcore/xyops/blob/main/docs/api.md Use this command to bootstrap xySat on a Windows system using a provided token and specifying the 'windows' OS. The script is executed via Invoke-WebRequest. ```powershell powershell -Command "IEX (Invoke-WebRequest -UseBasicParsing -Uri 'https://xyops01.example.com/api/app/satellite/install?t=TOKEN_HERE&os=windows').Content" ```