Class: UU::OperationRegistry::Node
- Inherits:
-
BaseMethods
- Object
- BaseMethods
- UU::OperationRegistry::Node
- Defined in:
- lib/uu/operation_registry/node.rb
Overview
Node.
Class Method Summary collapse
-
.create(host_uri, attributes) ⇒ UU::OS::UESURI
Creates a new node.
-
.delete(node_uri, parameters = {}) ⇒ void
Deletes the specified node from the registry.
-
.get_attributes(node_uri) ⇒ Hash
Gets the attributes of the node specified by node URI and returns its detail.
-
.get_node_list(host_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>
Returns list of nodes.
-
.set_attributes(node_uri, attributes) ⇒ UU::OS::UESURI
Sets attributes of an node.
Instance Method Summary collapse
-
#create(host_uri, attributes) ⇒ UU::OS::UESURI
Creates a new node.
-
#delete(node_uri, parameters = {}) ⇒ void
Deletes the specified node from the registry.
-
#get_attributes(node_uri) ⇒ Hash
Gets the attributes of the node specified by node URI and returns its detail.
-
#get_node_list(host_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>
Returns a list of nodes on the given host.
-
#initialize(session = nil) ⇒ Node
constructor
Creates a new instance of
Node
. -
#set_attributes(node_uri, attributes) ⇒ UU::OS::UESURI
Sets attributes of an node.
Constructor Details
#initialize(session = nil) ⇒ Node
Creates a new instance of Node
.
18 19 20 |
# File 'lib/uu/operation_registry/node.rb', line 18 def initialize(session = nil) super end |
Class Method Details
.create(host_uri, attributes) ⇒ UU::OS::UESURI
Creates a new node. This method is a convenience shortcut for the #create instance method.
|
# File 'lib/uu/operation_registry/node.rb', line 40
|
.delete(node_uri, parameters = {}) ⇒ void
This method returns an undefined value.
Deletes the specified node from the registry. This method is a convenience shortcut for the #delete instance method.
140 141 142 |
# File 'lib/uu/operation_registry/node.rb', line 140 def self.delete(node_uri, parameters = {}) self.new(UU::OS::Security::Session.current_session).delete(node_uri, parameters) end |
.get_attributes(node_uri) ⇒ Hash
Gets the attributes of the node specified by node URI and returns its detail. This method is a convenience shortcut for the #get_attributes instance method.
|
# File 'lib/uu/operation_registry/node.rb', line 53
|
.get_node_list(host_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>
Returns list of nodes. This method is a convenience shortcut for the #get_node_list instance method.
166 167 168 |
# File 'lib/uu/operation_registry/node.rb', line 166 def self.get_node_list(host_uri, criteria = {}) self.new(UU::OS::Security::Session.current_session).get_node_list(host_uri, criteria) end |
.set_attributes(node_uri, attributes) ⇒ UU::OS::UESURI
Sets attributes of an node. This method is a convenience shortcut for the #set_attributes instance method.
|
# File 'lib/uu/operation_registry/node.rb', line 77
|
Instance Method Details
#create(host_uri, attributes) ⇒ UU::OS::UESURI
Creates a new node.
|
# File 'lib/uu/operation_registry/node.rb', line 22
|
#delete(node_uri, parameters = {}) ⇒ void
This method returns an undefined value.
Deletes the specified node from the registry.
Node can be successfully deleted if all these conditions are met:
-
no container exists referencing this node (via
nodeUri
) -
nodeSizeUri
on this node is set -
node size referenced (via
nodeSizeUri
) from this node exists -
resourcePoolUri
on this node is set -
resource pool referenced (via
resourcePoolUri
) from this node exists
Note: Condition 1 ensures data consistency, conditions 2-5 ensure that a proper capacity log record can be created to terminate billing of the deleted node.
Under special circumstances, a node can eventually be deleted even if the
afforementioned conditions 2-5 are not met. This is possible setting
force
parameter to true
.
Note: If condition 1 is not met, the node cannot be deleted, not even if
force
is true
.
132 133 134 |
# File 'lib/uu/operation_registry/node.rb', line 132 def delete(node_uri, parameters = {}) client.invoke(:delete, node_uri, parameters: parameters) end |
#get_attributes(node_uri) ⇒ Hash
Gets the attributes of the node specified by node URI and returns its detail.
|
# File 'lib/uu/operation_registry/node.rb', line 47
|
#get_node_list(host_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>
Returns a list of nodes on the given host. Command does not return all nodes, only a sublist. The list of returned nodes could be filtered using Mongo Query.
157 158 159 |
# File 'lib/uu/operation_registry/node.rb', line 157 def get_node_list(host_uri, criteria = {}) @client.invoke(:getNodeList, host_uri, parameters: criteria) end |
#set_attributes(node_uri, attributes) ⇒ UU::OS::UESURI
Sets attributes of an node.
|
# File 'lib/uu/operation_registry/node.rb', line 60
|