以下是我尝试过的方法:
@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 =>参数disable_api_termination无法识别(Fog::Compute::AWS::Error)
谢谢!
发布于 2014-04-01 20:56:27
attrs应该只是一个哈希(而不是一个哈希数组)。如果将attrs分配更改为:
attrs = {
"DisableApiTermination.Value" => true
}我想这对你来说应该是有效的。
编辑:将key设置为字符串,而不是符号。
编辑:现在意识到它通过raw传递,而不是重新映射对象,所以我们需要显式地匹配api期望的内容。
https://stackoverflow.com/questions/22773865
复制相似问题