Class: Bosh::Clouds::ExternalCpi

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud/external_cpi.rb

Defined Under Namespace

Classes: InvalidResponse, NonExecutable, UnknownError

Constant Summary collapse

KNOWN_RPC_ERRORS =
%w(
  Bosh::Clouds::VMCreationFailed
  Bosh::Clouds::DiskNotFound
  Bosh::Clouds::DiskNotAttached
  Bosh::Clouds::NoDiskSpace
  Bosh::Clouds::CloudError
  Bosh::Clouds::CpiError
).freeze
KNOWN_RPC_METHODS =
%w(
  current_vm_id
  create_stemcell
  delete_stemcell
  create_vm
  delete_vm
  has_vm?
  reboot_vm
  set_vm_metadata
  configure_networks
  create_disk
  delete_disk
  attach_disk
  detach_disk
  snapshot_disk
  delete_snapshot
  get_disks
  ping
).freeze
RESPONSE_SCHEMA =
Membrane::SchemaParser.parse do
  {
    'result' => any,
    'error' => enum(nil,
      { 'type' => String,
        'message' => String,
        'ok_to_retry' => bool
      }
    ),
    'log' => String
  }
end

Instance Method Summary collapse

Constructor Details

#initialize(cpi_path, director_uuid) ⇒ ExternalCpi

Returns a new instance of ExternalCpi.



61
62
63
64
65
# File 'lib/cloud/external_cpi.rb', line 61

def initialize(cpi_path, director_uuid)
  @cpi_path = cpi_path
  @director_uuid = director_uuid
  @logger = Config.logger
end