Sha256: e0413bb80b587e11de40a4e70ea8a8c913e257624162f3cfc013727b202d5ec4

Contents?: true

Size: 1.33 KB

Versions: 25

Compression:

Stored size: 1.33 KB

Contents

module Fog
  module Compute
    class Linode
      class Real
        def image_delete(image_id)
          request(
            :expects  => 200,
            :method   => 'GET',
            :query    => {
              :api_action => 'image.delete',
              :imageId => image_id
            }
          )
        end
      end

      class Mock
        def image_delete(image_id, status='available')
          size = rand(1..999999)
          response = Excon::Response.new
          response.status = 200
          response.body = {
            "ERRORARRAY" => [],
            "ACTION"     => "image.delete",
            "DATA"       => { "LAST_USED_DT" => "2014-07-21 12:31:54.0",
                              "DESCRIPTION" => "Fog Mock Linode Image #{image_id}",
                              "LABEL" => "test_#{image_id}_image",
                              "STATUS" => status,
                              "SIZE" => size,
                              "ISPUBLIC" => rand(0..1),
                              "CREATE_DT" => "2014-06-23 13:45:12.0",
                              "USED" => rand(1..size),
                              "FS_TYPE" => "ext4",
                              "USERID" => Fog::Mock.random_numbers(4),
                              "IMAGEID" => image_id }
          }
          response
        end
      end
    end
  end
end

Version data entries

25 entries across 23 versions & 4 rubygems

Version Path
fog-2.3.0 lib/fog/linode/requests/compute/image_delete.rb
fog-ifeel-2.2.0 lib/fog/linode/requests/compute/image_delete.rb
fog-2.2.0 lib/fog/linode/requests/compute/image_delete.rb
fog-2.1.0 lib/fog/linode/requests/compute/image_delete.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/linode/requests/compute/image_delete.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/linode/requests/compute/image_delete.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/linode/requests/compute/image_delete.rb
fog-1.42.1 lib/fog/linode/requests/compute/image_delete.rb
fog-2.0.0 lib/fog/linode/requests/compute/image_delete.rb
fog-1.42.0 lib/fog/linode/requests/compute/image_delete.rb
fog-1.41.0 lib/fog/linode/requests/compute/image_delete.rb
fog-1.40.0 lib/fog/linode/requests/compute/image_delete.rb
fog-1.39.0 lib/fog/linode/requests/compute/image_delete.rb
fog-1.38.0 lib/fog/linode/requests/compute/image_delete.rb
fog-1.37.0 lib/fog/linode/requests/compute/image_delete.rb
fog-1.36.0 lib/fog/linode/requests/compute/image_delete.rb
fog-1.35.0 lib/fog/linode/requests/compute/image_delete.rb
fog-2.0.0.pre.0 lib/fog/linode/requests/compute/image_delete.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/linode/requests/compute/image_delete.rb
fog-1.34.0 lib/fog/linode/requests/compute/image_delete.rb