Class: Fog::Compute::IBM::Key

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/ibm/models/compute/key.rb

Instance Method Summary collapse

Instance Method Details

#default?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/fog/ibm/models/compute/key.rb', line 25

def default?
  default
end

#destroyObject



20
21
22
23
# File 'lib/fog/ibm/models/compute/key.rb', line 20

def destroy
  data = service.delete_key(identity)
  data.body['success']
end

#instancesObject



29
30
31
# File 'lib/fog/ibm/models/compute/key.rb', line 29

def instances
  instance_ids.map { Fog::Compute[:ibm].servers.get(instance_id) }
end

#saveObject



13
14
15
16
17
18
# File 'lib/fog/ibm/models/compute/key.rb', line 13

def save
  requires :name
  data = service.create_key(name, public_key)
  merge_attributes(data.body)
  data.body['keyName'] == name
end