Class: UU::OperationRegistry::Tenant

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

Overview

Tenant.

Constant Summary

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Tenant) initialize(session = nil)

Creates a new instance of Tenant.

Parameters:

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

    Session to use for remote calls.



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

def initialize(session = nil)
  super
end

Class Method Details

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

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

Parameters:

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

    Cloud URI.

  • attributes (Hash)

    Tenant attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created tenant.



# File 'lib/uu/operation_registry/tenant.rb', line 33

+ (void) delete(tenant_uri)

This method returns an undefined value.

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

Parameters:

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

    Tenant URI.



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

+ (Hash) get_attributes(tenant_uri)

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

Parameters:

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

    Tenant URI.

Returns:

  • (Hash)

    Tenant attributes.



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

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

Returns list of tenants. This method is a convenience shortcut for the #get_tenant_list instance method.

Returns:

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

    Paged result set.

See Also:



102
103
104
# File 'lib/uu/operation_registry/tenant.rb', line 102

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

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

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

Parameters:

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

    Tenant URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated tenant.



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

Instance Method Details

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

Creates a new tenant. Tenant is a representation of territory in operation registry.

Parameters:

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

    Cloud URI.

  • attributes (Hash)

    Tenant attributes.

Options Hash (attributes):

  • oid (String)

    Unique territory ID.

  • name (String)

    Territory name. May be nil.

  • code (String)

    Territory code.

  • description (String)

    Tenant description. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created tenant.



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

- (void) delete(tenant_uri)

This method returns an undefined value.

Deletes the specified tenant from the registry.

Parameters:

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

    Tenant URI.



# File 'lib/uu/operation_registry/tenant.rb', line 70

- (Hash) get_attributes(tenant_uri)

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

Parameters:

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

    Tenant URI.

Returns:

  • (Hash)

    Tenant attributes.



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

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

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

Parameters:

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

    Cloud URI.

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

    Criteria for listing tenants.

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.



93
94
95
# File 'lib/uu/operation_registry/tenant.rb', line 93

def get_tenant_list(cloud_uri, criteria = {})
  @client.invoke(:getTenantList, cloud_uri, parameters: criteria)
end

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

Sets attributes of an tenant.

Parameters:

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

    Tenant URI.

  • attributes (Hash)

    Tenant attributes.

Options Hash (attributes):

  • oid (String)

    Unique territory ID. May be nil.

  • name (String)

    Territory name. May be nil.

  • code (String)

    Territory code. May be nil.

  • description (String)

    Tenant description. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated tenant.



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