Class: UU::OperationRegistry::Node

Inherits:
BaseMethods
  • Object
show all
Defined in:
lib/uu/operation_registry/node.rb

Overview

Node.

Constant Summary

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Node) initialize(session = nil)

Creates a new instance of Node.

Parameters:

  • session (UU::OS::Security::Session) (defaults to: nil)

    Session to use for remote calls.



18
19
20
# File 'lib/uu/operation_registry/node.rb', line 18

def initialize(session = nil)
  super
end

Class Method Details

+ (UU::OS::UESURI) create(host_uri, attributes)

Creates a new node. This method is a convenience shortcut for the #create instance method.

Parameters:

  • host_uri (String, UU::OS::UESURI)

    Host URI.

  • attributes (Hash)

    Node attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created node.



# File 'lib/uu/operation_registry/node.rb', line 39

+ (void) delete(node_uri)

This method returns an undefined value.

Deletes the specified node from the registry. This method is a convenience shortcut for the #delete instance method.

Parameters:

  • node_uri (String, UU::OS::UESURI)

    Node URI.



# File 'lib/uu/operation_registry/node.rb', line 86

+ (Hash) get_attributes(node_uri)

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.

Parameters:

  • node_uri (String, UU::OS::UESURI)

    Node URI.

Returns:

  • (Hash)

    Node attributes.



# File 'lib/uu/operation_registry/node.rb', line 52

+ (UU::OS::Persistence::PagedResult<Hash>) get_node_list(host_uri, criteria = {})

Returns list of nodes. This method is a convenience shortcut for the #get_node_list instance method.

Returns:

  • (UU::OS::Persistence::PagedResult<Hash>)

    Paged result set.

See Also:



113
114
115
# File 'lib/uu/operation_registry/node.rb', line 113

def self.get_node_list(host_uri, criteria = {})
  self.new(UU::OS::Security::Session.current_session).get_node_list(host_uri, criteria)
end

+ (UU::OS::UESURI) set_attributes(node_uri, attributes)

Sets attributes of an node. This method is a convenience shortcut for the #set_attributes instance method.

Parameters:

  • node_uri (String, UU::OS::UESURI)

    Node URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated node.



# File 'lib/uu/operation_registry/node.rb', line 75

Instance Method Details

- (UU::OS::UESURI) create(host_uri, attributes)

Creates a new node.

Parameters:

  • host_uri (String, UU::OS::UESURI)

    Host URI.

  • attributes (Hash)

    Node attributes.

Options Hash (attributes):

  • name (String)

    Node name. May be nil.

  • code (String)

    Node code. May be nil.

  • description (String)

    Node description. May be nil.

  • nodeSizeUri (UU::OS::UESURI)

    Node class URI.

  • resourcePoolUri (UU::OS::UESURI)

    Resource pool this node belongs to.

  • hostname (String)

    Hostname of the host where the node is running. May be nil.

  • appDeploymentUri (UU::OS::UESURI)

    UESURI of deployment that this node belongs to. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created node.



# File 'lib/uu/operation_registry/node.rb', line 22

- (void) delete(node_uri)

This method returns an undefined value.

Deletes the specified node from the registry.

Parameters:

  • node_uri (String, UU::OS::UESURI)

    Node URI.



# File 'lib/uu/operation_registry/node.rb', line 81

- (Hash) get_attributes(node_uri)

Gets the attributes of the node specified by node URI and returns its detail.

Parameters:

  • node_uri (String, UU::OS::UESURI)

    Node URI.

Returns:

  • (Hash)

    Node attributes.



# File 'lib/uu/operation_registry/node.rb', line 46

- (UU::OS::Persistence::PagedResult<Hash>) get_node_list(host_uri, criteria = {})

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.

Parameters:

  • host_uri (String, UU::OS::UESURI)

    Host URI.

  • criteria (Hash) (defaults to: {})

    Criteria for listing nodes.

Options Hash (criteria):

  • query (String)

    Mongo Query to filter the result set. See Mongo Query tutorial.

  • pageIndex (Fixnum)

    Result set page index.

  • pageSize (Fixnum)

    Result set page size.

Returns:

  • (UU::OS::Persistence::PagedResult<Hash>)

    Paged result set.



104
105
106
# File 'lib/uu/operation_registry/node.rb', line 104

def get_node_list(host_uri, criteria = {})
  @client.invoke(:getNodeList, host_uri, parameters: criteria)
end

- (UU::OS::UESURI) set_attributes(node_uri, attributes)

Sets attributes of an node.

Parameters:

  • node_uri (String, UU::OS::UESURI)

    Node URI.

  • attributes (Hash)

    Node attributes.

Options Hash (attributes):

  • name (String)

    Node name. May be nil.

  • code (String)

    Node code. May be nil.

  • description (String)

    Node description. May be nil.

  • nodeSizeUri (UU::OS::UESURI)

    Node class URI. May be nil.

  • hostname (String)

    Hostname of the host where the node is running. May be nil.

  • appDeploymentUri (UU::OS::UESURI)

    UESURI of deployment that this node belongs to. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated node.



# File 'lib/uu/operation_registry/node.rb', line 59