Sha256: 51cfb2bb151969d50d4e4eb6b0c4bab4b1effe4a19a7204ba9d92730b5d1cf5e

Contents?: true

Size: 1.25 KB

Versions: 22

Compression:

Stored size: 1.25 KB

Contents

module ApiStub
  module Requests
    module Compute
      # Mock class for Virtual Machine Requests
      class Image
        def self.image_params
          {
            resource_group: 'fog-test-rg',
            vm_name: 'fog-test-server',
            location: 'westus',
            platform: 'Linux',
            new_vhd_path: 'https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd'
          }
        end

        def self.create_image(compute_client)
          body = {
            'location' => 'West US',
            'tags' => {
              'key' => 'value'
            },
            'properties' => {
              'storageProfile' => {
                'osDisk' => {
                  'osType' => 'Linux',
                  'blobUri' => 'https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd',
                  'osState' => 'generalized',
                  'hostCaching' => 'readwrite',
                  'storageAccountType' => 'Standard_LRS'
                },
                'provisioningState' => 'Succeeded'
              }
            }
          }
          image_mapper = Azure::ARM::Compute::Models::Image.mapper
          compute_client.deserialize(image_mapper, body, 'result.body')
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
fog-azure-rm-0.6.0 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.5.3 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.5.2 test/api_stub/requests/compute/image.rb
far-gem-0.5.6 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.5.1 test/api_stub/requests/compute/image.rb
far-gem-0.5.5 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.5.0 test/api_stub/requests/compute/image.rb
far-gem-0.5.4 test/api_stub/requests/compute/image.rb
far-gem-0.5.3 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.4.9 test/api_stub/requests/compute/image.rb
far-gem-0.5.2 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.4.8 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.4.7 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.4.6 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.4.5 test/api_stub/requests/compute/image.rb
fog-azure-rm-temp-0.0.5 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.4.4 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.4.3 test/api_stub/requests/compute/image.rb
far-gem-0.5.1 test/api_stub/requests/compute/image.rb
fog-azure-rm-0.4.2 test/api_stub/requests/compute/image.rb