{"id":14970138,"url":"https://github.com/hashicorp/vagrant_cloud","last_synced_at":"2025-04-05T15:06:18.227Z","repository":{"id":15662554,"uuid":"18399974","full_name":"hashicorp/vagrant_cloud","owner":"hashicorp","description":"Vagrant Cloud API wrapper for Ruby","archived":false,"fork":false,"pushed_at":"2025-03-28T16:02:50.000Z","size":416,"stargazers_count":16,"open_issues_count":4,"forks_count":18,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-29T14:09:00.735Z","etag":null,"topics":["api","cli","cloud","ruby","vagrant"],"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/hashicorp.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":"2014-04-03T11:02:07.000Z","updated_at":"2025-03-28T16:02:48.000Z","dependencies_parsed_at":"2024-06-12T15:39:18.723Z","dependency_job_id":"356bf772-8c86-4759-a39b-140931aab4ab","html_url":"https://github.com/hashicorp/vagrant_cloud","commit_stats":{"total_commits":216,"total_committers":18,"mean_commits":12.0,"dds":0.712962962962963,"last_synced_commit":"37313c639a1e0baa23e456a4e31bb2cbb1001c2f"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvagrant_cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvagrant_cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvagrant_cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvagrant_cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/vagrant_cloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353745,"owners_count":20925329,"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":["api","cli","cloud","ruby","vagrant"],"created_at":"2024-09-24T13:43:06.355Z","updated_at":"2025-04-05T15:06:18.209Z","avatar_url":"https://github.com/hashicorp.png","language":"Ruby","readme":"# vagrant_cloud\n\nRuby client for the [Vagrant Cloud API](https://www.vagrantup.com/docs/vagrant-cloud/api.html).\n\n[![Gem Version](https://img.shields.io/gem/v/vagrant_cloud.svg)](https://rubygems.org/gems/vagrant_cloud)\n\nThis library provides the functionality to create, modify, and delete boxes, versions,\nand providers on Vagrant Cloud.\n\n## Usage\n\nThe Vagrant Cloud library provides two methods for interacting with the Vagrant Cloud API. The\nfirst is direct interaction using a `VagrantCloud::Client` instance. The second is a basic\nmodel based approach using a `VagrantCloud::Account` instance.\n\n### Authentication\n\nThe access token that is used for authenticated requests can be set in one of three ways:\n\n* Static access token set directly in the client\n* Static access token extracted from the `VAGRANT_CLOUD_TOKEN` environment variable \n* Generated [HCP service principal](https://developer.hashicorp.com/hcp/docs/hcp/iam/service-principal) access token when `HCP_CLIENT_ID` and `HCP_CLIENT_SECRET` environment variables are set\n\n### Direct Client\n\nThe `VagrantCloud::Client` class contains all the underlying functionality which with\n`vagrant_cloud` library uses for communicating with Vagrant Cloud. It can be used directly\nfor quickly and easily sending requests to Vagrant Cloud. The `VagrantCloud::Client`\nclass will automatically handle any configured authentication, request parameter\nstructuring, and response validation. All API related methods in the `VagrantCloud::Client`\nclass will return `Hash` results.\n\nExample usage (display box details):\n\n```ruby\nrequire \"vagrant_cloud\"\n\nclient = VagrantCloud::Client.new(access_token: \"MY_TOKEN\")\nbox = client.box_get(username: \"hashicorp\", name: \"bionic64\")\n\nputs \"Box: #{box[:tag]} Description: #{box[:description]}\"\n```\n\nExample usage (creating box and releasing a new version):\n\n```ruby\nrequire \"vagrant_cloud\"\nrequire \"net/http\"\n\n# Create a new client\nclient = VagrantCloud::Client.new(access_token: \"MY_TOKEN\")\n\n# Create a new box\nclient.box_create(\n  username: \"hashicorp\",\n  name: \"test-bionic64\",\n  short_description: \"Test Box\",\n  long_description: \"Testing box for an example\",\n  is_private: false\n)\n\n# Create a new version\nclient.box_version_create(\n  username: \"hashicorp\",\n  name: \"test-bionic64\",\n  version: \"1.0.0\",\n  description: \"Version 1.0.0 release\"\n)\n\n# Create a new provider\nclient.box_version_provider_create(\n  username: \"hashicorp\",\n  name: \"test-bionic64\",\n  version: \"1.0.0\",\n  provider: \"virtualbox\"\n)\n\n# Request box upload URL\nupload_url = client.box_version_provider_upload(\n  username: \"hashicorp\",\n  name: \"test-bionic64\",\n  version: \"1.0.0\",\n  provider: \"virtualbox\"\n)\n\n# Upload box asset\nuri = URI.parse(upload_url[:upload_path])\nrequest = Net::HTTP::Post.new(uri)\nbox = File.open(BOX_PATH, \"rb\")\nrequest.set_form([[\"file\", box]], \"multipart/form-data\")\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme.eql?(\"https\")) do |http|\n  http.request(request)\nend\n\n# Release the version\nclient.box_version_release(\n  username: \"hashicorp\",\n  name: \"test-bionic64\",\n  version: \"1.0.0\"\n)\n```\n\n### Simple Models\n\nThe `VagrantCloud::Account` class is the entry point for using simple models to\ninteract with Vagrant Cloud.\n\nExample usage (display box details):\n\n```ruby\nrequire \"vagrant_cloud\"\n\naccount = VagrantCloud::Account.new(access_token: \"MY_TOKEN\")\norg = account.organization(name: \"hashicorp\")\nbox = org.boxes.detect { |b| b.name == \"bionic64\" }\n\nputs \"Box: #{box[:tag]} Description: #{box[:description]}\"\n```\n\nExample usage (creating box and releasing a new version):\n\n```ruby\nrequire \"vagrant_cloud\"\n\n# Load our account\naccount = VagrantCloud::Account.new(access_token: \"MY_TOKEN\")\n\n# Load organization\norg = account.organization(name: \"hashicorp\")\n\n# Create a new box\nbox = org.add_box(\"test-bionic64\")\nbox.description = \"Testing box for an example\"\nbox.short_description = \"Test Box\"\n\n# Create a new version\nversion = box.add_version(\"1.0.0\")\nversion.description = \"Version 1.0.0 release\"\n\n# Create a new provider\nprovider = version.add_provider(\"virtualbox\")\n\n# Save the box, version, and provider\nbox.save\n\n# Upload box asset\nprovider.upload(path: BOX_PATH)\n\n# Release the version\nversion.release\n```\n\n## Development \u0026 Contributing\n\nPull requests are very welcome!\n\nInstall dependencies:\n```\nbundle install\n```\n\nRun the tests:\n```\nbundle exec rspec\n```\n\n## Releasing\n\nRelease a new version:\n\n1. Update the version in the `version.txt` file\n1. Commit the change to master\n1. Create a new version tag in git: `git tag vX.X.X`\n1. Push the new tag and master to GitHub `git push origin main --tags`\n\nThe new release will be automatically built and published.\n\n## History\n\n- This gem was developed and maintained by [Cargo Media](https://www.cargomedia.ch) from April 2014 until October 2017.\n- The `vagrant_cloud` CLI tool included in this RubyGem has been deprecated and removed. See `vagrant cloud` for a replacement.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fvagrant_cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fvagrant_cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fvagrant_cloud/lists"}