Class: Kitchen::Driver::Oci::Models::Paravirtual

Inherits:
Blockstorage show all
Defined in:
lib/kitchen/driver/oci/models/paravirtual.rb

Overview

paravirtual attachment model

Instance Attribute Summary collapse

Attributes inherited from Blockstorage

#api, #config, #oci, #state, #volume_attachment_state, #volume_state

Instance Method Summary collapse

Methods inherited from Blockstorage

#attach_volume, #create_volume, #delete_volume, #detatch_volume, #final_state

Methods inherited from Kitchen::Driver::Oci

#create, #destroy, validation_error

Methods included from Kitchen::Driver::Oci::Models

#instance_class, #volume_class

Constructor Details

#initialize(config, state, oci, api) ⇒ Paravirtual

Returns a new instance of Paravirtual.



26
27
28
29
# File 'lib/kitchen/driver/oci/models/paravirtual.rb', line 26

def initialize(config, state, oci, api)
  super
  @attachment_type = "paravirtual"
end

Instance Attribute Details

#attachment_typeString (readonly)

The type of attachment being created

Returns:

  • (String)


36
37
38
# File 'lib/kitchen/driver/oci/models/paravirtual.rb', line 36

def attachment_type
  @attachment_type
end

Instance Method Details

#attachment_details(volume_details, server_id) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/kitchen/driver/oci/models/paravirtual.rb', line 38

def attachment_details(volume_details, server_id)
  OCI::Core::Models::AttachParavirtualizedVolumeDetails.new(
    display_name: "#{attachment_type}-#{volume_details.display_name}",
    volume_id: volume_details.id,
    instance_id: server_id
  )
end

#final_volume_attachment_state(response) ⇒ Object



46
47
48
49
50
# File 'lib/kitchen/driver/oci/models/paravirtual.rb', line 46

def final_volume_attachment_state(response)
  volume_attachment_state.store(:id, response.id)
  volume_attachment_state.store(:display_name, response.display_name)
  volume_attachment_state
end