{"id":21939191,"url":"https://github.com/grottopress/lester","last_synced_at":"2025-04-22T14:49:44.717Z","repository":{"id":85788143,"uuid":"417443691","full_name":"GrottoPress/lester","owner":"GrottoPress","description":"A low-level API client for LXD","archived":false,"fork":false,"pushed_at":"2024-08-15T16:48:25.000Z","size":307,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-16T15:03:34.112Z","etag":null,"topics":["crystal","devops","http-client","lxd","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrottoPress.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-15T09:32:03.000Z","updated_at":"2024-08-15T16:48:28.000Z","dependencies_parsed_at":"2024-08-15T14:59:43.674Z","dependency_job_id":"52c4dbf9-d1ee-40bf-9768-dd19c3ff7ca5","html_url":"https://github.com/GrottoPress/lester","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Flester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Flester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Flester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Flester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrottoPress","download_url":"https://codeload.github.com/GrottoPress/lester/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227025005,"owners_count":17719205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crystal","devops","http-client","lxd","rest-api"],"created_at":"2024-11-29T02:17:19.062Z","updated_at":"2024-11-29T02:17:20.380Z","avatar_url":"https://github.com/GrottoPress.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lester\n\n*Lester* is a low-level API client for [*LXD*](https://linuxcontainers.org/lxd/). It features an intuitive interface that maps directly to the *LXD* API.\n\n### Usage Examples\n\n1. Create client:\n\n   ```crystal\n   lxd = Lester.new(socket: \"/var/snap/lxd/common/lxd/unix.socket\")\n\n   # OR:\n   #\n   # lxd = Lester.new(\n   #   base_uri: \"https://1.2.3.4:8443\",\n   #   private_key: \"priv.key\",\n   #   certificate: \"cert.pem\",\n   #   # ca_certificates: \"ca.pem\",\n   #   # verify_mode: \"none\"\n   # )\n   ```\n\n1. Add new trusted certificate:\n\n   ```crystal\n   lxd.certificates.add(\n     certificate: \"X509 PEM certificate...\",\n     name: \"castiana\",\n     password: \"secret\",\n     # ...\n   ) do |response|\n     return puts response.message unless response.success?\n\n     puts response.type\n     puts response.code\n   end\n   ```\n\n1. List all images:\n\n   ```crystal\n   lxd.images.list(project: \"default\") do |response|\n     return puts response.message unless response.success?\n\n     response.metadata.try \u0026.each do |image|\n       puts image.architecture\n       puts image.auto_update?\n       puts image.cached?\n       # ...\n     end\n   end\n   ```\n\n1. Download instance backup:\n\n   ```crystal\n   lxd.instances.backups.export(\n     instance_name: \"instance-04\",\n     name: \"backup0\",\n     destination: \"/home/user/Downloads/backup.zip\"\n   ) do |response|\n     puts response.message\n   end\n   ```\n\n1. Add new storage pool:\n\n   ```crystal\n   lxd.pools.create(\n     project: \"default\",\n     target: \"lxd0\",\n     config: {\"volume.block.filesystem\": \"ext4\", \"volume.size\": \"50GiB\"},\n     description: \"Local SSD pool\",\n     driver: \"zfs\",\n     name: \"local\",\n     # ...\n   ) do |response|\n     return puts response.message unless response.success?\n\n     puts response.type\n     puts response.code\n   end\n   ```\n\n## Documentation\n\nFind the complete documentation in the `docs/` directory of this repository.\n\n## Development\n\n1. Create a `.env.sh` file:\n\n   ```bash\n   #!/bin/bash\n   #\n\n   export LXD_SOCKET='/var/snap/lxd/common/lxd/unix.socket'\n\n   # Set these if you need to test against a remote LXD server\n   export LXD_BASE_URI='https://1.2.3.4:8443'\n   export LXD_TLS_KEY_PATH='priv.key'\n   export LXD_TLS_CERT_PATH='cert.pem'\n   export LXD_TLS_CA_PATH=''\n   export LXD_TLS_VERIFY_MODE='none'\n   ```\n\n   Update the file with your own details.\n\n1. Run tests with `source .env.sh \u0026\u0026 crystal spec`.\n\n## Contributing\n\n1. [Fork it](https://github.com/GrottoPress/lester/fork)\n1. Switch to the `master` branch: `git checkout master`\n1. Create your feature branch: `git checkout -b my-new-feature`\n1. Make your changes, updating changelog and documentation as appropriate.\n1. Commit your changes: `git commit`\n1. Push to the branch: `git push origin my-new-feature`\n1. Submit a new *Pull Request* against the `GrottoPress:master` branch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Flester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrottopress%2Flester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Flester/lists"}