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

Provides the storage abstraction for Resources. More...

Public Member Functions

def __init__
 
def zeroize
 Wipe database of all data. More...
 
def add_resource
 Add or update a resource uniquely identified by resid More...
 
def remove_resource
 Remove resource. More...
 
def get_resource
 Get one resource using user provided name for resource. More...
 
def has_resource_by_name
 Check if storage has resource in storage. More...
 
def has_resource_by_id
 Check if storage has resource in storage. More...
 
def get_resource_names
 Get all resource names. More...
 
def get_resources
 Get all resources. More...
 
def __init__
 
def zeroize
 Wipe database of all data. More...
 
def add_resource
 Add or update a resource uniquely identified by resid More...
 
def remove_resource
 Remove resource. More...
 
def get_resource
 Get one resource using user provided name for resource. More...
 
def has_resource_by_name
 Check if storage has resource in storage. More...
 
def has_resource_by_id
 Check if storage has resource in storage. More...
 
def get_resource_names
 Get all resource names. More...
 
def get_resources
 Get all resources. More...
 

Detailed Description

Provides the storage abstraction for Resources.

Note
: A resource id is unique together with source.

Constructor & Destructor Documentation

def etr.plugins.resources.Storage.__init__ (   self,
  db 
)
Parameters
dbSqlite3 database file (can also be :memory: for in-memory storage).
def etr.plugins.resources.Storage.__init__ (   self,
  db 
)
Parameters
dbSqlite3 database file (can also be :memory: for in-memory storage).

Member Function Documentation

def etr.plugins.resources.Storage.add_resource (   self,
  source,
  resid,
  name,
  attributes 
)

Add or update a resource uniquely identified by resid

Parameters
sourceresource source (e.g. hostname)
residresource id
nameuser provided resource name
attributesattributes to store
def etr.plugins.resources.Storage.add_resource (   self,
  source,
  resid,
  name,
  attributes 
)

Add or update a resource uniquely identified by resid

Parameters
sourceresource source (e.g. hostname)
residresource id
nameuser provided resource name
attributesattributes to store
def etr.plugins.resources.Storage.get_resource (   self,
  name 
)

Get one resource using user provided name for resource.

Parameters
nameresource name
   Returns `Resource`
def etr.plugins.resources.Storage.get_resource (   self,
  name 
)

Get one resource using user provided name for resource.

Parameters
nameresource name
   Returns `Resource`
def etr.plugins.resources.Storage.get_resource_names (   self,
  List,
  str 
)

Get all resource names.

Returns List of resource names

def etr.plugins.resources.Storage.get_resource_names (   self,
  List,
  str 
)

Get all resource names.

Returns List of resource names

def etr.plugins.resources.Storage.get_resources (   self,
  List,
  Resource 
)

Get all resources.

Returns list of Resources: [Resource(source, resid, name, attributes),...]

def etr.plugins.resources.Storage.get_resources (   self,
  List,
  Resource 
)

Get all resources.

Returns list of Resources: [Resource(source, resid, name, attributes),...]

def etr.plugins.resources.Storage.has_resource_by_id (   self,
  source,
  resid 
)

Check if storage has resource in storage.

Parameters
sourceresource source
residresource id
Returns
True if storage has resource False otherwise
def etr.plugins.resources.Storage.has_resource_by_id (   self,
  source,
  resid 
)

Check if storage has resource in storage.

Parameters
sourceresource source
residresource id
Returns
True if storage has resource False otherwise
def etr.plugins.resources.Storage.has_resource_by_name (   self,
  name 
)

Check if storage has resource in storage.

Parameters
nameresource name
Returns
True if storage has resource False otherwise
def etr.plugins.resources.Storage.has_resource_by_name (   self,
  name 
)

Check if storage has resource in storage.

Parameters
nameresource name
Returns
True if storage has resource False otherwise
def etr.plugins.resources.Storage.remove_resource (   self,
  source,
  resid 
)

Remove resource.

Parameters
sourceresource source
residresource id
def etr.plugins.resources.Storage.remove_resource (   self,
  source,
  resid 
)

Remove resource.

Parameters
sourceresource source
residresource id
def etr.plugins.resources.Storage.zeroize (   self)

Wipe database of all data.

def etr.plugins.resources.Storage.zeroize (   self)

Wipe database of all data.


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