Class: Bosh::Director::Models::PersistentDisk

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/models/persistent_disk.rb

Instance Method Summary collapse

Instance Method Details

#cloud_propertiesObject



13
14
15
16
# File 'lib/bosh/director/models/persistent_disk.rb', line 13

def cloud_properties
  result = self.cloud_properties_json
  result ? JSON.parse(result) : {}
end

#cloud_properties=(cloud_properties) ⇒ Object



18
19
20
# File 'lib/bosh/director/models/persistent_disk.rb', line 18

def cloud_properties=(cloud_properties)
  self.cloud_properties_json = JSON.generate(cloud_properties)
end

#validateObject



8
9
10
11
# File 'lib/bosh/director/models/persistent_disk.rb', line 8

def validate
  validates_presence [:instance_id, :disk_cid]
  validates_unique [:disk_cid]
end