seq  1.1.0
 All Classes Namespaces Files Functions Variables Groups Pages
Public Member Functions | List of all members
etr.plugins.resources.ResourceManager Class Reference

Resource Manager that acquires and releases resources as well as keeping the record of acquired/released resources. More...

Public Member Functions

def __init__
 
def has_sources
 Returns true if there are any sources configured, false otherwise. More...
 
def acquire_resource
 Acquire a matching resource using a type and a list of tags. More...
 
def release_resource
 Releases specified resource and then remove it from the database. More...
 
def get_acquired_resources
 Get already acquired resources. More...
 
def get_acquired_resource_names
 Get already acquired resources names. More...
 
def release_all_resources
 Release all acquired resources. More...
 

Detailed Description

Resource Manager that acquires and releases resources as well as keeping the record of acquired/released resources.

Resource Manager has two resource provider sources, the remote service and the local host "offline" resource configuration.

Resource Manager prioritizes the local resources if it matches.

Constructor & Destructor Documentation

def etr.plugins.resources.ResourceManager.__init__ (   self,
  resfile,
  host,
  storage 
)
Parameters
resfileResource file for local resources
hostAddress to the remote resource manager
storageThe storage manager to use

Member Function Documentation

def etr.plugins.resources.ResourceManager.acquire_resource (   self,
  name,
  type,
  tags = None 
)

Acquire a matching resource using a type and a list of tags.

   First acquisition from local resources is attempted. If that fails the remote service is
   attempted.
Parameters
nameClients name for the resource.
typeResource type
tagsTags that must match. Optional and is empty by default.
Returns
attributes
def etr.plugins.resources.ResourceManager.get_acquired_resource_names (   self)

Get already acquired resources names.

def etr.plugins.resources.ResourceManager.get_acquired_resources (   self)

Get already acquired resources.

def etr.plugins.resources.ResourceManager.has_sources (   self)

Returns true if there are any sources configured, false otherwise.

def etr.plugins.resources.ResourceManager.release_all_resources (   self)

Release all acquired resources.

def etr.plugins.resources.ResourceManager.release_resource (   self,
  source,
  resource_id 
)

Releases specified resource and then remove it from the database.

Parameters
sourceSource url for the resource
resource_idUnique resource id
Todo:
: Check that we release from the correct source?

The documentation for this class was generated from the following file: