Class: UU::OperationRegistry::NodeSet

Inherits:
BaseMethods
  • Object
show all
Defined in:
lib/uu/operation_registry/node_set.rb,
lib/uu/operation_registry/node_set_slot.rb

Overview

Node set.

Defined Under Namespace

Classes: Slot

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session = nil) ⇒ NodeSet

Creates a new instance of NodeSet.

Parameters:

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

    Session to use for remote calls.



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

def initialize(session = nil)
  super
end

Class Method Details

.create(resource_pool_uri, attributes) ⇒ UU::OS::UESURI

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

Parameters:

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

    Resource pool URI.

  • attributes (Hash)

    Node set attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created node set.



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

.delete(node_set_uri) ⇒ void

This method returns an undefined value.

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

Parameters:

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

    Node set URI.



# File 'lib/uu/operation_registry/node_set.rb', line 103

.get_attributes(node_set_uri) ⇒ Hash

Gets the attributes of the node set specified by container URI and returns its detail. This method is a convenience shortcut for the #get_attributes instance method.

Parameters:

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

    Node set URI.

Returns:

  • (Hash)

    Node set attributes.



# File 'lib/uu/operation_registry/node_set.rb', line 62

.get_node_set_list(resource_pool_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>

Returns list of node sets. This method is a convenience shortcut for the #get_node_set_list instance method.

Returns:

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

    Paged result set.

See Also:



133
134
135
# File 'lib/uu/operation_registry/node_set.rb', line 133

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

.set_attributes(node_set_uri, attributes) ⇒ UU::OS::UESURI

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

Parameters:

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

    Node set URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated node set.



# File 'lib/uu/operation_registry/node_set.rb', line 92

Instance Method Details

#create(resource_pool_uri, attributes) ⇒ UU::OS::UESURI

Creates a new NodeSet.

Parameters:

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

    Resource pool URI.

  • attributes (Hash)

    Node node set attributes.

Options Hash (attributes):

  • name (String)

    Node set name.

  • code (String)

    Node set code. May be nil.

  • urlPath (String)

    URL path.

  • balancingStrategy (String)

    Balancing strategy. May be nil.

  • appDeploymentUri (UU::OS::UESURI)

    UESURI of deployment that this node set belongs to.

  • nodeSizeUri (UU::OS::UESURI)

    UESURI of NodeSize used by this NodeSet. May be nil.

  • nodeImageUri (UU::OS::UESURI)

    UESURI of NodeImage used by this NodeSet. May be nil.

  • inboundPorts (Array<Fixnum>)

    Inbound ports used for Swarm-NodeProvider NodeSets. May be nil.

  • slot (String)

    Slot to which the created NodeSets will belong to. One of PRODUCTION, BETA or NONE. NONE is special value which means that the NodeSet is not routed from any gateway. This value should be used only internally by C3. May be nil. If not specified PRODUCTION slot will be used.

  • networkCidr (String)

    Network CIDR (e.g. 10.0.2.0/24) of internal network that enables communication among nodes belonging to this node set. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created node set.



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

#delete(node_set_uri) ⇒ void

This method returns an undefined value.

Deletes the specified node set from the registry.

Parameters:

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

    Node set URI.



# File 'lib/uu/operation_registry/node_set.rb', line 98

#get_attributes(node_set_uri) ⇒ Hash

Note:

Attributes “nodeSizeUri”, “nodeCount”, “inboundPorts” and “networkCidr” are set only for ResourceGroup of type “SWARM”.

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

Parameters:

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

    Node set URI.

Returns:

  • (Hash)

    Node set attributes.



# File 'lib/uu/operation_registry/node_set.rb', line 53

#get_node_set_list(resource_pool_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>

Note:

Attributes “nodeSizeUri”, “nodeCount”, “inboundPorts” and “networkCidr” are set only for ResourceGroup of type “SWARM”.

Returns a list of node sets in the given resource pool. Command does not return all node sets, only a sublist. The list of returned node sets could be filtered using Mongo Query.

Parameters:

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

    Resource pool URI.

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

    Criteria for listing node sets.

Options Hash (criteria):

  • query (String)

    Mongo Query to filter the result set. See Mongo Query tutorial. Allowed query filter document fields: code, urlPath, resourcePoolUri, networkCidr

  • pageIndex (Fixnum)

    Result set page index.

  • pageSize (Fixnum)

    Result set page size.

Returns:

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

    Paged result set.



124
125
126
# File 'lib/uu/operation_registry/node_set.rb', line 124

def get_node_set_list(resource_pool_uri, criteria = {})
  @client.invoke(:getNodeSetList, resource_pool_uri, parameters: criteria)
end

#set_attributes(node_set_uri, attributes) ⇒ UU::OS::UESURI

Sets attributes of a node set.

Parameters:

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

    Node set URI.

  • attributes (Hash)

    Node set attributes.

Options Hash (attributes):

  • name (String)

    Node set name. May be nil.

  • code (String)

    Node set code. May be nil.

  • urlPath (String)

    URL path. May be nil.

  • balancingStrategy (String)

    Balancing strategy. May be nil.

  • nodeImageUri. (UU::OS::UESURI)

    URI of nodeImage.

  • nodeSizeUri (UU::OS::UESURI)

    URI of nodeSize.

  • appDeploymentUri (UU::OS::UESURI)

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

  • slot (String)

    Slot to which the created NodeSets will belong to. One of PRODUCTION, BETA or NONE. NONE is special value which means that the NodeSet is not routed from any gateway. This value should be used only internally by C3. May be nil. If not specified PRODUCTION slot will be used.

  • networkCidr (String)

    Network CIDR (e.g. 10.0.2.0/24) of internal network that enables communication among nodes belonging to this node set. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated node set.



# File 'lib/uu/operation_registry/node_set.rb', line 69