server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
# Destroy an instance, given its id.
Destroy an instance, given its id.
Destroy an instance given its id .
def destroy_instance(credentials, id)
    safely do
      client = new_client(credentials)
      vsys_id = client.extract_vsys_id(id)
      if id == "#{vsys_id}-S-0001" 
        client.destroy_vsys(vsys_id)
      else
        begin
          client.destroy_vserver(id)
        rescue Exception => ex
          if not ex.message =~ /VALIDATION_ERROR.*/
            raise ex
          else
            begin
              client.destroy_efm(id)
            rescue
              raise ex
            end
          end
        end
      end
    end
  end
def destroy_instance ( credentials , id ) safely do client = new_client ( credentials ) vsys_id = client . extract_vsys_id ( id ) if id == "#{vsys_id}-S-0001" client . destroy_vsys ( vsys_id ) else begin client . destroy_vserver ( id ) rescue Exception => ex if not ex . message =~ / VALIDATION_ERROR.* / raise ex else begin client . destroy_efm ( id ) rescue raise ex end end end end end end
Destroy an instance, given its id.
Destroy an instance given its id .
# if FW # vserver or SLB (no way to tell which from id) # if not found, try destroying as SLB # if that fails as well, just raise the original error
credentials
<not_specific>
id
<not_specific>