All Projects → hashicorp → vagrant_cloud

hashicorp / vagrant_cloud

Licence: MIT license
Vagrant Cloud API wrapper for Ruby

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to vagrant cloud

saltstack-lxc-vagrant
Vagrantfile for setting up a SaltStack test/dev environment.
Stars: ✭ 13 (-18.75%)
Mutual labels:  vagrant
kubernetes the easy way
Automating Kubernetes the hard way with Vagrant and scripts
Stars: ✭ 22 (+37.5%)
Mutual labels:  vagrant
vagrant-templates
Vagrantfiles for self-contained development/test environments.
Stars: ✭ 28 (+75%)
Mutual labels:  vagrant
acquia-cloud-vm
VirtualBox/Vagrant-based VM to closely match Acquia Cloud environment.
Stars: ✭ 20 (+25%)
Mutual labels:  vagrant
vebs
Reusable Bash provisioning scripts for Vagrant (or Ubuntu 14.04) environments.
Stars: ✭ 13 (-18.75%)
Mutual labels:  vagrant
k8s0
Another minimal kubernetes with ansible
Stars: ✭ 23 (+43.75%)
Mutual labels:  vagrant
packer-kali linux
This is a repository that will be used to help create a process of a new kali vagrant box for hashicorp each week.
Stars: ✭ 36 (+125%)
Mutual labels:  vagrant
docker-case
这个项目主要是为了快速拉起docker服务
Stars: ✭ 31 (+93.75%)
Mutual labels:  vagrant
kubeadm-vagrant
Setup Kubernetes Cluster with Kubeadm and Vagrant
Stars: ✭ 49 (+206.25%)
Mutual labels:  vagrant
vagrant-openstack
Vagrant OpenStack-Ansible Environment used by OpenStack Cloud Computing Cookbook 4th Edition
Stars: ✭ 45 (+181.25%)
Mutual labels:  vagrant
opnsense-starterkit
Try opnsense, build opnsense images or start development
Stars: ✭ 18 (+12.5%)
Mutual labels:  vagrant
kubernetes-cluster
Vagrant As Automation Script
Stars: ✭ 34 (+112.5%)
Mutual labels:  vagrant
smartserver
SmartHome Server deployment setup
Stars: ✭ 14 (-12.5%)
Mutual labels:  vagrant
ansible-vbox-vagrant-kubernetes
Building a Kubernetes Cluster with Vagrant and Ansible
Stars: ✭ 70 (+337.5%)
Mutual labels:  vagrant
ypereirareis.github.io
DevOps, Symfony and VueJs developer. Articles and experiences on docker, grafana, prometheus, RabbitMQ, PHP, MySQL, Admin, Nginx, Haproxy, SSH,...
Stars: ✭ 15 (-6.25%)
Mutual labels:  vagrant
packer-FreeBSD
Build a FreeBSD VM for Vagrant using packer
Stars: ✭ 23 (+43.75%)
Mutual labels:  vagrant
arch-ansible
An Ansible playbook to install Arch Linux
Stars: ✭ 33 (+106.25%)
Mutual labels:  vagrant
junos-orchestration-with-vagrant
How to orchestrate and provision Junos virtual machines with Vagrant
Stars: ✭ 14 (-12.5%)
Mutual labels:  vagrant
TYPOTry
A small Vagrant box to try out the most recent TYPO3 release
Stars: ✭ 21 (+31.25%)
Mutual labels:  vagrant
builderator
Tools to make CI Packer builds awesome
Stars: ✭ 21 (+31.25%)
Mutual labels:  vagrant

vagrant_cloud

Ruby client for the Vagrant Cloud API.

Gem Version

This library provides the functionality to create, modify, and delete boxes, versions, and providers on Vagrant Cloud.

Usage

The Vagrant Cloud library provides two methods for interacting with the Vagrant Cloud API. The first is direct interaction using a VagrantCloud::Client instance. The second is a basic model based approach using a VagrantCloud::Account instance.

Direct Client

The VagrantCloud::Client class contains all the underlying functionality which with vagrant_cloud library uses for communicating with Vagrant Cloud. It can be used directly for quickly and easily sending requests to Vagrant Cloud. The VagrantCloud::Client class will automatically handle any configured authentication, request parameter structuring, and response validation. All API related methods in the VagrantCloud::Client class will return Hash results.

Example usage (display box details):

require "vagrant_cloud"

client = VagrantCloud::Client.new(access_token: "MY_TOKEN")
box = client.box_get(username: "hashicorp", name: "bionic64")

puts "Box: #{box[:tag]} Description: #{box[:description]}"

Example usage (creating box and releasing a new version):

require "vagrant_cloud"
require "net/http"

# Create a new client
client = VagrantCloud::Client.new(access_token: "MY_TOKEN")

# Create a new box
client.box_create(
  username: "hashicorp",
  name: "test-bionic64",
  short_description: "Test Box",
  long_description: "Testing box for an example",
  is_private: false
)

# Create a new version
client.box_version_create(
  username: "hashicorp",
  name: "test-bionic64",
  version: "1.0.0",
  description: "Version 1.0.0 release"
)

# Create a new provider
client.box_version_provider_create(
  username: "hashicorp",
  name: "test-bionic64",
  version: "1.0.0",
  provider: "virtualbox"
)

# Request box upload URL
upload_url = client.box_version_provider_upload(
  username: "hashicorp",
  name: "test-bionic64",
  version: "1.0.0",
  provider: "virtualbox"
)

# Upload box asset
uri = URI.parse(upload_url[:upload_path])
request = Net::HTTP::Post.new(uri)
box = File.open(BOX_PATH, "rb")
request.set_form([["file", box]], "multipart/form-data")
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme.eql?("https")) do |http|
  http.request(request)
end

# Release the version
client.box_version_release(
  username: "hashicorp",
  name: "test-bionic64",
  version: "1.0.0"
)

Simple Models

The VagrantCloud::Account class is the entry point for using simple models to interact with Vagrant Cloud.

Example usage (display box details):

require "vagrant_cloud"

account = VagrantCloud::Account.new(access_token: "MY_TOKEN")
org = account.organization(name: "hashicorp")
box = org.boxes.detect { |b| b.name == "bionic64" }

puts "Box: #{box[:tag]} Description: #{box[:description]}"

Example usage (creating box and releasing a new version):

require "vagrant_cloud"

# Load our account
account = VagrantCloud::Account.new(access_token: "MY_TOKEN")

# Load organization
org = account.organization(name: "hashicorp")

# Create a new box
box = org.add_box("test-bionic64")
box.description = "Testing box for an example"
box.short_description = "Test Box"

# Create a new version
version = box.add_version("1.0.0")
version.description = "Version 1.0.0 release"

# Create a new provider
provider = version.add_provider("virtualbox")

# Save the box, version, and provider
box.save

# Upload box asset
provider.upload(path: BOX_PATH)

# Release the version
version.release

Development & Contributing

Pull requests are very welcome!

Install dependencies:

bundle install

Run the tests:

bundle exec rspec

Releasing

Release a new version:

  1. Update the version in the version.txt file
  2. Commit the change to master
  3. Create a new version tag in git: git tag vX.X.X
  4. Push the new tag and master to GitHub git push origin main --tags

The new release will be automatically built and published.

History

  • This gem was developed and maintained by Cargo Media from April 2014 until October 2017.
  • The vagrant_cloud CLI tool included in this RubyGem has been deprecated and removed. See vagrant cloud for a replacement.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].