Class: UU::OperationRegistry::ResourcePool

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

Overview

Resource pool.

Constant Summary

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ResourcePool) initialize(session = nil)

Creates a new instance of Resource pool.

Parameters:

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

    Session to use for remote calls.



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

def initialize(session = nil)
  super
end

Class Method Details

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

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

Parameters:

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

    Tenant URI.

  • attributes (Hash)

    Resource pool attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created pool.



# File 'lib/uu/operation_registry/resource_pool.rb', line 44

+ (void) delete(resource_pool_uri)

This method returns an undefined value.

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

Parameters:

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

    Resource pool URI.



# File 'lib/uu/operation_registry/resource_pool.rb', line 95

+ (Hash) get_attributes(resource_pool_uri)

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

Parameters:

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

    Resource pool URI.

Returns:

  • (Hash)

    Resource pool attributes.



# File 'lib/uu/operation_registry/resource_pool.rb', line 57

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

Returns list of resource pools. This method is a convenience shortcut for the #get_resource_pool_list instance method.

Returns:

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

    Paged result set.

See Also:



122
123
124
# File 'lib/uu/operation_registry/resource_pool.rb', line 122

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

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

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

Parameters:

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

    Resource pool URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated pool.



# File 'lib/uu/operation_registry/resource_pool.rb', line 84

Instance Method Details

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

Creates a new resource pool.

Parameters:

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

    Tenant URI.

  • attributes (Hash)

    Resource pool attributes.

Options Hash (attributes):

  • name (String)

    Resource pool name. May be nil.

  • code (String)

    Resource pool code. May be nil.

  • description (String)

    Resource pool description. May be nil.

  • accessGroupUri (UU::OS::UESURI)

    URI of group used to verify access rights manipulate with the resource pool (e.g. deploy apps to it).

  • contractedCapacity (Hash)

    Contracted capacity for this resource pool. 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).

  • resourceGroupUri (UU::OS::UESURI)

    URI of resource group that resources in this pool belong to.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created pool.



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

- (void) delete(resource_pool_uri)

This method returns an undefined value.

Deletes the specified pool from the registry.

Parameters:

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

    Resource pool URI.



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

- (Hash) get_attributes(resource_pool_uri)

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

Parameters:

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

    Resource pool URI.

Returns:

  • (Hash)

    Resource pool attributes.



# File 'lib/uu/operation_registry/resource_pool.rb', line 51

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

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

Parameters:

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

    Tenant URI.

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

    Criteria for listing pools.

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.



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

def get_resource_pool_list(tenant_uri, criteria = {})
  @client.invoke(:getResourcePoolList, tenant_uri, parameters: criteria)
end

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

Sets attributes of an pool.

Parameters:

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

    Resource pool URI.

  • attributes (Hash)

    Resource pool attributes.

Options Hash (attributes):

  • name (String)

    Resource pool name. May be nil.

  • code (String)

    Resource pool code. May be nil.

  • description (String)

    Resource pool description. May be nil.

  • accessGroupUri (UU::OS::UESURI)

    URI of group used to verify access rights manipulate with the resource pool (e.g. deploy apps to it).

  • contractedCapacity (Hash)

    Contracted capacity for this resource pool. 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 pool.



# File 'lib/uu/operation_registry/resource_pool.rb', line 64