mirror of
https://github.com/azukaar/Cosmos-Server.git
synced 2026-10-11 21:49:51 +00:00
1.1 KiB
1.1 KiB
Cosmos SDK Examples
Practical, runnable examples using the cosmos-cloud-sdk package. Each script reads COSMOS_URL and COSMOS_TOKEN from environment variables.
export COSMOS_URL=https://my-cosmos.example.com
export COSMOS_TOKEN=cosmos_xxx
Examples
Dashboard
Server overview: list running containers, read system metrics, fetch recent events, and display container logs.
node sdk/examples/dashboard.mjs
CI/CD Deploy
Deploy a compose-style service (images are pulled automatically) — designed for CI pipelines (GitHub Actions, GitLab CI, etc.).
DEPLOY_IMAGE=nginx:latest node sdk/examples/cicd-deploy.mjs
Container Management
Container lifecycle: stop, start, restart, rolling image update, log search, and auto-update toggle.
node sdk/examples/container-management.mjs my-container
Backup & Jobs
List backup repositories and snapshots, trigger backups, and manage scheduled jobs.
node sdk/examples/backup-and-jobs.mjs