{"id":22454687,"url":"https://github.com/niwo/cloudstack_client","last_synced_at":"2025-08-02T02:31:38.137Z","repository":{"id":12496508,"uuid":"15166059","full_name":"niwo/cloudstack_client","owner":"niwo","description":"Ruby library to interact with the CloudStack API","archived":false,"fork":false,"pushed_at":"2025-01-24T06:59:00.000Z","size":298,"stargazers_count":14,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T05:19:58.202Z","etag":null,"topics":["cloudstack","cloudstack-api"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/niwo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-13T14:52:00.000Z","updated_at":"2025-01-24T06:58:22.000Z","dependencies_parsed_at":"2022-09-16T23:01:36.172Z","dependency_job_id":null,"html_url":"https://github.com/niwo/cloudstack_client","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/niwo/cloudstack_client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niwo","download_url":"https://codeload.github.com/niwo/cloudstack_client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack_client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267527833,"owners_count":24102017,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cloudstack","cloudstack-api"],"created_at":"2024-12-06T07:08:51.268Z","updated_at":"2025-08-02T02:31:37.867Z","avatar_url":"https://github.com/niwo.png","language":"Ruby","readme":"# cloudstack_client\n\n[![Gem Version](https://badge.fury.io/rb/cloudstack_client.png)](http://badge.fury.io/rb/cloudstack_client)\n [![Build Status](https://travis-ci.com/niwo/cloudstack_client.svg?branch=master)](https://travis-ci.com/niwo/cloudstack_client)\n\nA CloudStack API client written in Ruby.\n\n## Installation\n\nInstall the cloudstack_client gem:\n\n```bash\n$ gem install cloudstack_client\n```\n\n## Features\n\n- Access to the whole CloudStack-API from Ruby\n- Interactive console for playing with the CloudStack API: ```cloudstack_client console```\n- Dynamically builds API methods based on the listApis function of CloudStack\n- Command names are converted to match Ruby naming conventions (i.e. ListVirtualMachines becomes list_virtual_machines)\n- Accepts Ruby Hash arguments passed to commands as options (i.e. list_all: true becomes listall=true)\n- Assure all required arguments are passed\n- Removes unsupported arguments and arguments with nil values from commands\n\n## Usage\n\n### Basic usage\n\n```ruby\nrequire \"cloudstack_client\"\n\ncs = CloudstackClient::Client.new(\n  \"https://cloudstack.local/client/api\",\n  \"API_KEY\",\n  \"SECRET_KEY\"\n)\n\ncs.list_virtual_machines(state: \"running\").each do |vm|\n  puts vm[\"name\"]\nend\n```\n\n### Advanced Options\n\nLoad API definition file from an alternative path and set the version:\n\n```ruby\ncs = CloudstackClient::Client.new(\n  \"https://cloudstack.local/client/api\",\n  \"API_KEY\",\n  \"SECRET_KEY\",\n  {\n    api_path: \"~/cloudstack\",\n    api_version: \"4.15\"\n  }\n)\n```\n\n...or load the API definition directly from a file:\n\n```ruby\ncs = CloudstackClient::Client.new(\n  \"https://cloudstack.local/client/api\",\n  \"API_KEY\",\n  \"API_SECRET\",\n  { api_file: \"~/cloudstack/4.15.json.gz\" }\n)\n```\n\n### Using the configuration module\n\nThe configuration module of CloudstackClient makes it easy to load CloudStack API settings from configuration files.\n\n#### Example\n\n```ruby\nrequire \"cloudstack_client\"\nrequire \"cloudstack_client/configuration\"\n\n# looks for ~/.cloudstack.yml per default\nconfig = CloudstackClient::Configuration.load\ncs = CloudstackClient::Client.new(config[:url], config[:api_key], config[:secret_key])\n```\n\n#### Configuration files\n\nConfiguration files support multiple environments (i.e. `~/.cloudstack.yml`):\n\n```yaml\n# default environment\n:default: production\n\n# production environment\nproduction:\n  :url: \"https://my-cloudstack-server/client/api/\"\n  :api_key: \"cloudstack-api-key\"\n  :secret_key: \"cloudstack-api-secret\"\n\n# test environment\ntest:\n  :url: \"http://my-cloudstack-testserver/client/api/\"\n  :api_key: \"cloudstack-api-key\"\n  :secret_key: \"cloudstack-api-secret\"\n```\n\n### Configuration options\nYou can pass `options` as 4th argument in `CloudstackClient::Client.new`. All its keys are optional.\n\n```ruby\noptions = {\n  symbolize_keys: true, # pass symbolize_names: true in JSON#parse for Cloudstack responses, default: false\n  host: 'localhost', # custom host header to be used in Net::Http. May be useful when Cloudstack is set up locally via docker (i.e. Cloudstack-simulator), default: parsed from config[:url] via Net::Http\n  read_timeout: 10 # timeout in seconds of a connection to the Cloudstack, default: 60\n}\ncs = CloudstackClient::Client.new(config[:url], config[:api_key], config[:secret_key], options)\n```\n\n### Interactive Console\n\ncloudstack_client comes with an interactive console.\n\n#### Example\n\n```bash\n$ cloudstack_client console -e prod\nprod \u003e\u003e list_virtual_machines\n```\n\n## Development\n\n### Generate or update API definitions\n\nNew API definitions can be generated using the `list_apis` command.\n\n#### Example\n\n```bash\n# running against a CloudStack 4.15 API endpoint:\n$ cloudstack_client list_apis \u003e data/4.15.json\n$ gzip data/4.15.json\n```\n\n## References\n\n- [Apache CloudStack API documentation](http://cloudstack.apache.org/api/apidocs-4.15/)\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\n\nReleased under the MIT License. See the [LICENSE](https://raw.github.com/niwo/cloudstack_client/master/LICENSE.txt) file for further details.\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Vagrant"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniwo%2Fcloudstack_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniwo%2Fcloudstack_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniwo%2Fcloudstack_client/lists"}