Coder Social home page Coder Social logo

cloudstack_ruby_client's People

Contributors

a1eef avatar alepore avatar chipchilders avatar chiradeep avatar davemcneill avatar devnuller avatar gloppasglop avatar isaacchiang avatar kplawver avatar pdion891 avatar rmc3 avatar tgraham avatar ypz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudstack_ruby_client's Issues

Support HTTP Post in API

As of 4.2, cloudstack supports http post for the updateVirtualMachine api call. It would be great if there were a way to specify http POST or GET for all the the api commands, and have a way to provide a json body for post requests.

Requesting multiple machine states

I'm looking to find all states that are not equal to destroyed or expunging, so it possible for list_virtual_machines to ask for multiple machine states e.g. state = 'Running, Stopped'.

Adding Tags Syntax

I'm trying to get the create_tags call to work, and I' struggling to decipher what format the tags parameter should be in. The API documentation says 'Map of tags (key/value pairs)'

I have tried using a hash:

cs_response     = client.create_tags({ 'resourceids'   => vm_id,
                                       'resourcetype' => 'UserVm',
                                       'tags'         => { "permission" => 'guest' }
                                    })

However this does not seem to work. Can anyone assist?

Calls over https url failing

The ssl option does not curently appear to work. When setting use_ssl to true, requests fail with the following error:
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2564:in read_status_line': wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">" (Net::HTTPBadResponse) from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2551:inread_new'
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:1319:in block in transport_request' from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:1316:incatch'
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:1316:in transport_request' from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:1293:inrequest'
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:1286:in block in request' from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:745:instart'
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:1284:in request' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/cloudstack_ruby_client-0.2.3/lib/cloudstack_ruby_client/base_client.rb:27:inrequest'
from (eval):39:in list_public_ip_addresses' from /export/home/gkremer/make_port_forward.rb:9:in

'

This seems to originate from lines 23 & 24 in base_client.rb being commented out. After restoring these lines, https calls worked for me.

Using tag search

Can you advise what the format for tag search is on e.g. list_virtual_machines

I'm struggling to get it working!

Not working on MRI 1.9.3

when running plain test I get:

/home/xxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:2564:in `read_status_line': wrong status line: "\x15\x03\x01\x00\x02\x02" (Net::HTTPBadResponse)
 from /home/hanuman/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
        from /home/hanuman/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
        from /home/hanuman/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
        from /home/hanuman/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
        from /home/hanuman/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1293:in `request'
        from /home/hanuman/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
        from /home/hanuman/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:745:in `start'
        from /home/hanuman/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1284:in `request'
        from /home/hanuman/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cloudstack_ruby_client-0.2.3/lib/cloudstack_ruby_client/base_client.rb:27:in `request'

As you can see, error pops out ruby standard library net/http.

Same thing with ruby 1.8.7:

/home/hanuman/.rbenv/versions/1.8.7-p371/lib/ruby/1.8/net/http.rb:2030:in `read_status_line': wrong status line: "\025\003\001\000\002\002" (Net::HTTPBadResponse)
        from /home/hanuman/.rbenv/versions/1.8.7-p371/lib/ruby/1.8/net/http.rb:2017:in `read_new'
        from /home/hanuman/.rbenv/versions/1.8.7-p371/lib/ruby/1.8/net/http.rb:1051:in `request'
        from /home/hanuman/.rbenv/versions/1.8.7-p371/lib/ruby/1.8/net/http.rb:1037:in `request'
        from /home/hanuman/.rbenv/versions/1.8.7-p371/lib/ruby/1.8/net/http.rb:543:in `start'
        from /home/hanuman/.rbenv/versions/1.8.7-p371/lib/ruby/1.8/net/http.rb:1035:in `request'
        from /home/hanuman/.rbenv/versions/1.8.7-p371/lib/ruby/gems/1.8/gems/cloudstack_ruby_client-0.2.3/lib/cloudstack_ruby_client/base_client.rb:27:in `request'
        from (eval):39:in `list_virtual_machines'

cloudstack is running on https version 4.2.0.

Fetching with https://github.com/snumano/CloudStack-API works fine.

client.create_volume appears to be broken

I am able to use various other create commands, but when I try to use:

client.create_volume(:name => "blah")

I get an error, as far as I can tell it should be working as name is the only requirement for creating volumes.

Bug in signature generation???

Hey Chip,

Can you verify your signature generation? I have some perl code which works, that generates the following URL to pull back the json.
Perl:
http://oak1-to-bl0001.oak1.atomz.com:8080/client/api?apiKey=K1q9NLDrswm-I3UMjR8fKlQ2Kzlb9Uv_pH-82jeMulE3DdEHaTeFcdrkEocIDtR17QxQndowZ1oAiBhwhXu1zQ&command=listVirtualMachines&response=json&signature=Uo0LO9k32a6SflTrEfDZlT1kQ7A%3D

However submitting the same values in your ruby code returns the following. Which does not work.

Ruby:
http://oak1-to-bl0001.oak1.atomz.com:8080/client/api?apiKey=K1q9NLDrswm-I3UMjR8fKlQ2Kzlb9Uv_pH-82jeMulE3DdEHaTeFcdrkEocIDtR17QxQndowZ1oAiBhwhXu1zQ&command=listVirtualMachines&response=json&signature=pNq8C4tPXe3KX0ND6wBjbRkx1gw%3D

Returns:


401

unable to verify user credentials and/or request signature


Is there anything that I'm doing wrong, or is there a bug in signature generation?

/Alistair

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.