Class: UU::OperationRegistry::Host

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

Overview

Host.

Constant Summary

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Host) initialize(session = nil)

Creates a new instance of Host.

Parameters:

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

    Session to use for remote calls.



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

def initialize(session = nil)
  super
end

Class Method Details

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

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

Parameters:

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

    ResourceGroup URI.

  • attributes (Hash)

    Host attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created host.



# File 'lib/uu/operation_registry/host.rb', line 40

+ (void) delete(host_uri)

This method returns an undefined value.

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

Parameters:

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

    Host URI.



# File 'lib/uu/operation_registry/host.rb', line 90

+ (Hash) get_attributes(host_uri)

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

Parameters:

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

    Host URI.

Returns:

  • (Hash)

    Host attributes.



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

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

Returns list of hosts. This method is a convenience shortcut for the #get_host_list instance method.

Returns:

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

    Paged result set.

See Also:



117
118
119
# File 'lib/uu/operation_registry/host.rb', line 117

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

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

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

Parameters:

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

    Host URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated host.



# File 'lib/uu/operation_registry/host.rb', line 79

Instance Method Details

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

Creates a new host.

Parameters:

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

    ResourceGroup URI.

  • attributes (Hash)

    Host attributes.

Options Hash (attributes):

  • name (String)

    Host name. May be nil.

  • code (String)

    Host code. May be nil.

  • description (String)

    Host description. May be nil.

  • hostname (String)

    Name of the physical host.

  • totalCapacity (Hash)

    Total capacity this host can provide for running nodes. Supported keys and value types: {cpu: Numeric, mem: Fixnum, storage: Fixnum}. All keys must have values.

    • :cpu (Fixnum) Number of virtual CPU cores.

    • :mem (Fixnum) Memory limit in MB (Megabytes).

    • :storage (Fixnum) Maximum storage limit in MB (Megabytes).

Returns:

  • (UU::OS::UESURI)

    UESURI of the created host.



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

- (void) delete(host_uri)

This method returns an undefined value.

Deletes the specified host from the registry.

Parameters:

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

    Host URI.



# File 'lib/uu/operation_registry/host.rb', line 85

- (Hash) get_attributes(host_uri)

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

Parameters:

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

    Host URI.

Returns:

  • (Hash)

    Host attributes.



# File 'lib/uu/operation_registry/host.rb', line 47

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

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

Parameters:

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

    ResourceGroup URI.

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

    Criteria for listing hosts.

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.



108
109
110
# File 'lib/uu/operation_registry/host.rb', line 108

def get_host_list(resource_group_uri, criteria = {})
  @client.invoke(:getHostList, resource_group_uri, parameters: criteria)
end

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

Sets attributes of a host.

Parameters:

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

    Host URI.

  • attributes (Hash)

    Host attributes.

Options Hash (attributes):

  • name (String)

    Host name. May be nil.

  • code (String)

    Host code. May be nil.

  • description (String)

    Host description. May be nil.

  • hostname (String)

    Name of the physical host. May be nil.

  • totalCapacity (Hash)

    Total capacity this host can provide for running nodes. May be nil. Supported keys and value types: {cpu: Numeric, mem: Fixnum, storage: Fixnum}. All values are optional.

    • :cpu (Fixnum) Number of virtual CPU cores.

    • :mem (Fixnum) Memory limit in MB (Megabytes).

    • :storage (Fixnum) Maximum storage limit in MB (Megabytes).

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated host.



# File 'lib/uu/operation_registry/host.rb', line 60