Sha256: 169c6e6f33d0f85c89e8c3000494d642228f8306c528e62c010b39c00e9f4fdf
Contents?: true
Size: 1.24 KB
Versions: 17
Compression:
Stored size: 1.24 KB
Contents
require 'fog/openstack/models/model' module Fog module Baremetal class OpenStack class Port < Fog::OpenStack::Model identity :uuid attribute :address attribute :uuid #detailed attribute :created_at attribute :updated_at attribute :extra attribute :node_uuid def create requires :address, :node_uuid merge_attributes(service.create_port(self.attributes).body) self end def update(patch=nil) requires :uuid, :address, :node_uuid if patch merge_attributes(service.patch_port(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_port(self.uuid) true end def metadata requires :uuid service.get_port(self.uuid).headers end end end end end
Version data entries
17 entries across 17 versions & 2 rubygems