server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
# Stop an instance, given its id.
Stop an instance, given its id.
Stop an instance given its id .
def stop_instance(credentials, id)
    safely do
      client = new_client(credentials)
      if id =~ /^.*-S-0001/ 
        client.stop_efm(id)
      else
        begin
          client.stop_vserver(id)
        rescue Exception => ex
          if not ex.message =~ /VALIDATION_ERROR.*/
            raise ex
          else
            begin
              client.stop_efm(id)
            rescue
              raise ex
            end
          end
        end
      end
    end
    instances(credentials, {:id => id}).first
  end
def stop_instance ( credentials , id ) safely do client = new_client ( credentials ) if id =~ / ^.*-S-0001 / client . stop_efm ( id ) else begin client . stop_vserver ( id ) rescue Exception => ex if not ex . message =~ / VALIDATION_ERROR.* / raise ex else begin client . stop_efm ( id ) rescue raise ex end end end end end instances ( credentials , { :id => id } ) . first end
Stop an instance, given its id.
Stop an instance given its id .
# FW # vserver or SLB (no way to tell which from id) #if not found, try stopping as SLB # if that fails as well, just raise the original error
credentials
<not_specific>
id
<not_specific>