Class: UU::OperationRegistry::NodeSize

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

Overview

Node Size.

Constant Summary

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (NodeSize) initialize(session = nil)

Creates a new instance of NodeSize.

Parameters:

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

    Session to use for remote calls.



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

def initialize(session = nil)
  super
end

Class Method Details

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

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

Parameters:

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

    Cloud URI.

  • attributes (Hash)

    Node size attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created node size.



# File 'lib/uu/operation_registry/node_size.rb', line 36

+ (void) delete(node_size_uri)

This method returns an undefined value.

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

Parameters:

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

    Node size URI.



# File 'lib/uu/operation_registry/node_size.rb', line 77

+ (Hash) get_attributes(node_size_uri)

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

Parameters:

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

    Node size URI.

Returns:

  • (Hash)

    Node size attributes.



# File 'lib/uu/operation_registry/node_size.rb', line 49

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

Returns list of sizes. This method is a convenience shortcut for the #get_node_size_list instance method.

Returns:

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

    Paged result set.

See Also:



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

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

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

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

Parameters:

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

    Node size URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated node size.



# File 'lib/uu/operation_registry/node_size.rb', line 66

Instance Method Details

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

Creates a new node size.

Parameters:

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

    Cloud URI.

  • attributes (Hash)

    Node size attributes.

Options Hash (attributes):

  • name (String)

    Node size name. May be nil.

  • code (String)

    Node size code. May be nil.

  • description (String)

    Node size description. May be nil.

  • mem (Fixnum)

    Memory limit in MB (Megabytes).

  • cpu (Fixnum)

    Number of virtual CPU cores.

  • storage (Fixnum)

    Maximum storage limit in MB (Megabytes).

Returns:

  • (UU::OS::UESURI)

    UESURI of the created node size.



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

- (void) delete(node_size_uri)

This method returns an undefined value.

Deletes the specified node size from the registry.

Parameters:

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

    Node size URI.



# File 'lib/uu/operation_registry/node_size.rb', line 72

- (Hash) get_attributes(node_size_uri)

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

Parameters:

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

    Node size URI.

Returns:

  • (Hash)

    Node size attributes.



# File 'lib/uu/operation_registry/node_size.rb', line 43

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

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

Parameters:

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

    Cloud URI.

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

    Criteria for listing sizes.

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.



95
96
97
# File 'lib/uu/operation_registry/node_size.rb', line 95

def get_node_size_list(cloud_uri, criteria = {})
  client.invoke(:getNodeSizeList, cloud_uri, parameters: criteria)
end

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

Sets attributes of a node size.

Parameters:

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

    Node size URI.

  • attributes (Hash)

    Node size attributes.

Options Hash (attributes):

  • name (String)

    Node size name. May be nil.

  • code (String)

    Node size code. May be nil.

  • description (String)

    Node size description. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated node size.



# File 'lib/uu/operation_registry/node_size.rb', line 56