Code Monkey home page Code Monkey logo

ruby-proxmox's Introduction

Proxmox

A ruby gem for managing Proxmox Servers with Ruby. Based on https://github.com/nledez/proxmox

Usage Information

Current build: RubyGem

Rubydoc

Inspirated from: https://bitbucket.org/jmoratilla/knife-proxmox/ but I would like to have the same without chef. https://github.com/maxschulze/uv_proxmox but listing some task does not work for me. No tests, use ssh.

Documentation from:

Installation

Add this line to your application's Gemfile:

gem 'proxmox'

And then execute:

$ bundle

Or install it yourself as:

$ gem install proxmox

Usage

require 'awesome_print'
require 'proxmox'

def wait_status(server1, task)
  puts task
  while server1.task_status(task) == "running"
    puts '.'
    sleep 1
  end

  puts server1.task_status(task)
end

server1 =
Proxmox::Proxmox.new("https://the-proxmox-server:8006/api2/json/",
"node", "root", "secret", "pam")
ap server1.templates

vm1 = server1.openvz_post("ubuntu-10.04-standard_10.04-4_i386", 200)
wait_status(server1, vm1)

ap server1.openvz_vm_status(200)
vm1 = server1.openvz_vm_start(200)
begin
  wait_status(server1, vm1)
rescue
end
sleep 5
ap server1.openvz_vm_shutdown(200)
begin
  wait_status(server1, vm1)
rescue
end
sleep 5
ap server1.openvz_vm_status(200)

vm1 = server1.openvz_delete(200)
wait_status(server1, vm1)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Create spec (in file spec/lib/proxmox_spec.rb)
  4. Write your code (in lib/proxmox.rb)
  5. Check spec & coverage (bundle exec rspec or bundle exec guard)
  6. Commit your changes (git commit -am 'Add some feature')
  7. Push to the branch (git push origin my-new-feature)
  8. Create new Pull Request

ruby-proxmox's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.