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_and_delete, #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.



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

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

Instance Attribute Details

#attachment_typeObject (readonly)

Returns the value of attribute attachment_type.



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

def attachment_type
  @attachment_type
end

Instance Method Details

#attachment_details(volume_details, server_id) ⇒ Object



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

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



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

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