Class: Kitchen::Driver::Oci::Models::Iscsi

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

Overview

iscsi volume 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) ⇒ Iscsi

Returns a new instance of Iscsi.



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

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

Instance Attribute Details

#attachment_typeObject (readonly)

Returns the value of attribute attachment_type.



26
27
28
# File 'lib/kitchen/driver/oci/models/iscsi.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/iscsi.rb', line 33

def attachment_details(volume_details, server_id)
  OCI::Core::Models::AttachIScsiVolumeDetails.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
46
47
48
# File 'lib/kitchen/driver/oci/models/iscsi.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.store(:iqn_ipv4, response.ipv4)
  volume_attachment_state.store(:iqn, response.iqn)
  volume_attachment_state.store(:port, response.port)
  volume_attachment_state
end