Sha256: 3e2da0c22681992af3c7499522c0f3b1cdec799235974a8ee6f56d5feea844be

Contents?: true

Size: 1.28 KB

Versions: 7

Compression:

Stored size: 1.28 KB

Contents

module Fog
  module Volume
    class OpenStack
      class V1
        class Real
          def create_volume_snapshot(volume_id, name, description, force=false)
            data = {
                'snapshot' => {
                    'volume_id'           => volume_id,
                    'display_name'        => name,
                    'display_description' => description,
                    'force'               => force
                }
            }

            _create_volume_snapshot(data)
          end

          include Fog::Volume::OpenStack::Real

        end

        class Mock
          def create_volume_snapshot(volume_id, name, description, force=false)
            response        = Excon::Response.new
            response.status = 202
            response.body   = {
                "snapshot" => {
                    "status"              => "creating",
                    "display_name"        => name,
                    "created_at"          => Time.now,
                    "display_description" => description,
                    "volume_id"           => volume_id,
                    "id"                  => "5",
                    "size"                => 1
                }
            }
            response
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fog-openstack-0.1.5 lib/fog/openstack/requests/volume_v1/create_volume_snapshot.rb
fog-openstack-0.1.4 lib/fog/openstack/requests/volume_v1/create_volume_snapshot.rb
fog-openstack-0.1.3 lib/fog/openstack/requests/volume_v1/create_volume_snapshot.rb
fog-openstack-0.1.2 lib/fog/openstack/requests/volume_v1/create_volume_snapshot.rb
fog-openstack-0.1.1 lib/fog/openstack/requests/volume_v1/create_volume_snapshot.rb
fog-openstack-0.1.0 lib/fog/openstack/requests/volume_v1/create_volume_snapshot.rb
fog-1.37.0 lib/fog/openstack/requests/volume_v1/create_volume_snapshot.rb