0

Here is what I have tried:

@cloud = Fog::Compute::New(<SECRET STUFF HERE>)
server = @cloud.servers.get('i-abcdef12')

attrs = {
    "disable_api_termination" => true 
}

@cloud.modify_instance_attribute(server.id,attrs)

.rvm/gems/ruby-1.9.2-p320/gems/excon-0.31.0/lib/excon/middlewares/expects.rb:10:in `response_call': UnknownParameter => The parameter disable_api_termination is not recognized (Fog::Compute::AWS::Error)

Thanks!

Knomad
  • 1
  • 1

1 Answers1

1

attrs should just be a hash (not an array of hashes). If you change the attrs assignment to:

attrs = {
  "DisableApiTermination.Value" => true 
}

I think it should work for you.

EDIT: made key a string instead of a symbol.

EDIT: realizing now that it passes this through raw instead of remapping things, so we need to explicitly match what the api expects.

geemus
  • 2,522
  • 16
  • 22
  • I tried that as well without success. I get an error: ruby-1.9.2-p320/gems/fog-1.20.0/lib/fog/aws/core.rb:117:in `sort': comparison of Symbol with String failed (ArgumentError) from .rvm/gems/ruby-1.9.2-p320/gems/fog-1.20.0/lib/fog/aws/core.rb:117:in `signed_params' from .rvm/gems/ruby-1.9.2-p320/gems/fog-1.20.0/lib/fog/aws/compute.rb:424:in `request' from .rvm/gems/ruby-1.9.2-p320/gems/fog-1.20.0/lib/fog/aws/requests/compute/modify_instance_attribute.rb:33:in `modify_instance_attribute' from ./mod_attr.rb:30:in `
    '
    – Knomad Apr 01 '14 at 14:50
  • oops, right. Updated above to something that should hopefully be more helpful. – geemus Apr 03 '14 at 15:50
  • I spent a couple of hours on this yesterday, trying everything I could think of without success. I have updated my post to show exactly what is being done and the error I get. Help! – Knomad Apr 09 '14 at 14:31
  • Sorry about that, I got sidetracked by the explicit error you were getting and failed to realize we just needed to match it directly to the parameters that AWS expects. I've made another edit above and I think/hope that should get you to where you need to go. Sorry for the confusion. – geemus Apr 11 '14 at 13:39