Sha256: 3662744a80b95c41dff00ccbfd1a32ff229d5de9842bfe59ab69b1f78411d3cc
Contents?: true
Size: 1.52 KB
Versions: 2
Compression:
Stored size: 1.52 KB
Contents
# coding: utf-8 # # Author:: Dangleterre Michaël # © Copyright ArubaCloud. # # LICENSE: MIT (http://opensource.org/licenses/MIT) # require 'fog/arubacloud/service' require 'fog/arubacloud/error' require 'benchmark' module Fog module ArubaCloud class Compute class Real def archive_vm(data) (service.servers).all.each do |server| id = server.id if (server.name).include? data[:name] and (server.vm_type).include? 'pro' end body = self.body('SetEnqueueServerArchiviation').merge( { :SetEnqueueServerArchiviation => { :ServerId => id } } ) response = nil time = Benchmark.realtime { response = request(body, 'SetEnqueueServerArchiviation', 'SetEnqueueServerArchiviation Error') } Fog::Logger.debug("SetEnqueueServerArchiviation time: #{time}") if response['Success'] response else raise Fog::ArubaCloud::Errors::RequestError.new(response) end end # archive_vm end # Real class Mock def archive_vm response = Excon::Response.new response.status = 200 response.body = { 'ExceptionInfo' => nil, 'ResultCode' => 0, 'ResultMessage' => nil, 'Success' => true } response.body end # archive_vm end # Mock end # Compute end # ArubaCloud end # Fog
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fog-arubacloud-0.0.6 | lib/fog/arubacloud/compute/requests/archive_vm.rb |
fog-arubacloud-0.0.5 | lib/fog/arubacloud/compute/requests/archive_vm.rb |