Sha256: 8722e4a84052270b986293bf44e580465c63591a9cf4d9e02946b9468c866303
Contents?: true
Size: 1.45 KB
Versions: 6
Compression:
Stored size: 1.45 KB
Contents
require 'fog/core/model' module Fog module Baremetal class OpenStack class Chassis < Fog::Model identity :uuid attribute :description attribute :uuid #detailed attribute :created_at attribute :updated_at attribute :extra def initialize(attributes) # Old 'connection' is renamed as service and should be used instead prepare_service_value(attributes) super end def save requires :description identity ? update : create end def create requires :description merge_attributes(service.create_chassis(self.attributes).body) self end def update(patch=nil) requires :uuid if patch merge_attributes(service.patch_chassis(uuid, patch).body) else # TODO implement update_node method using PUT method and self.attributes # once it is supported by Ironic raise ArgumentError, ('You need to provide patch attribute. Ironic does ' 'not support update by hash yet, only by jsonpatch.') end self end def destroy requires :uuid service.delete_chassis(self.uuid) true end def metadata requires :uuid service.get_chassis(self.uuid).headers end end end end end
Version data entries
6 entries across 6 versions & 2 rubygems