softlayer / softlayer-ruby

http://softlayer.github.io/softlayer-ruby/
MIT License
54 stars 35 forks source link

Having trouble cancelling a Bare Metal Server. #82

Closed thejohnlin closed 9 years ago

thejohnlin commented 9 years ago

I'm running into a NoMethodError originating from the .billingItem call in the SoftLayer::BareMetalServer.cancel! method.

Code Snippet: bm = SoftLayer::BareMetalServer.server_with_id(id, options = {}) bm.cancel!(:unneeded, '')

c:/Ruby193/lib/ruby/gems/1.9.1/gems/softlayer_api-3.0.0/lib/softlayer/BareMetalServer.rb:53:in cancel!': undefined method billingItem' for #<SoftLayer::BareMetalServer:0x428a318, jhlintestbm> (NoMethodError)

Any input would be greatly appreciated, thanks!

ju2wheels commented 9 years ago

Edit c:/Ruby193/lib/ruby/gems/1.9.1/gems/softlayer_api-3.0.0/lib/softlayer/BareMetalServer.rb and change line 53 to this:

softlayer_client[:Billing_Item].object_with_id(self.service.object_mask("mask[id]").getBillingItem['id'].to_i).cancelService()
SLsthompson commented 9 years ago

I'll try to get the fix integrated by Friday