Sha256: 46257caf4c9c0c8ec5866d0ec56ad7773ab506b6cb7b8d08baada96e447212e1
Contents?: true
Size: 1.11 KB
Versions: 9
Compression:
Stored size: 1.11 KB
Contents
module Fog module Compute class QingCloud class Real # Delete a key pair that you own # {API Reference}[https://docs.qingcloud.com/api/eip/change_address_bandwidth.html] def change_address_bandwidth(id, bandwidth) args = { 'action' => 'ChangeEipsBandwidth', 'bandwidth' => bandwidth }.merge(Fog::QingCloud.indexed_param('eips', id)) request(args) end end class Mock def change_address_bandwidth(id, bandwidth) response = Excon::Response.new response.status = 200 unless (unknown_eips = [*id] - self.data[:addresses].keys).empty? raise Fog::QingCloud::Errors::NotFound, "unknown eips: #{unknown_eips.join(', ')}" end [*id].each do |x| self.data[:addresses][x]['bandwidth'] = bandwidth end response.body = { 'action' => 'ChangeEipsBandwidthResponse', 'job_id' => Fog::QingCloud::Mock.job_id, 'ret_code' => 0 } response end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems