Module gip_storage :: Class StorageElement
[hide private]
[frames] | no frames]

Class StorageElement

source code

object --+
         |
        StorageElement

This class represents a logical StorageElement.

The class implements the necessary functions for a generic SRM v2.2 based storage element - however, it leaves many things blank as there's no way to determine space available, etc. Provider implementors for SEs should subclass this and implement SE-specific functions.

Instance Methods [hide private]
 
__init__(self, cp, section='se')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
getSection(self)
Return the ConfigParser section this StorageElement is using.
source code
 
run(self)
Run whatever data-gathering activities which need to be done.
source code
 
getServiceVOs(self)
Return the list of VOs which are allowed to access this service.
source code
 
getServiceVersions(self)
Return the list of supported SRM versions.
source code
 
getAccessProtocols(self)
Stub function for providing access protocol information.
source code
 
hasSRM(self)
Return True if there is a SRM endpoint present on this SE.
source code
 
getSRMs(self)
Return a list of dictionaries containing information about the SRM endpoints.
source code
 
getName(self)
Return the name of the SE.
source code
 
getUniqueID(self)
Return the unique ID of the SE.
source code
 
getStatus(self)
Return the status of the SE.
source code
 
getImplementation(self)
Return the implementation name for this SE.
source code
 
getVersion(self)
Return a version string for this SE.
source code
 
getSESpace(self, gb=False, total=False)
Returns information about the SE disk space.
source code
 
hasTape(self)
Returns true if the SE has an attached tape system.
source code
 
getSETape(self)
Retrieve the freespace information from the tape systems.
source code
 
getSEArch(self)
Returns the SE architecture.
source code
 
getSAs(self)
Return a list of storage areas at this site.
source code
 
getVOInfos(self)
Return a list of VOInfo dictionaries.
source code
 
getVOsForSpace(self, space)
Given a certain space, return a list of
source code
 
getPathForSA(self, space=None, vo=None, return_default=True, section='se')
Return a path appropriate for a VO and space.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cp, section='se')
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

run(self)

source code 

Run whatever data-gathering activities which need to be done.

For the base class, this is a no-op.

getAccessProtocols(self)

source code 

Stub function for providing access protocol information.

Return a list of dictionaries. Each dictionary will have the following keys with reference to an access endpoint:

  • protocol
  • hostname
  • port

Optionally, the following keys may be included (default in parenthesis):

  • capability (file transfer)
  • maxStreams (1)
  • securityinfo (none)
  • version (UNKNOWN)
  • endpoint (<protocol>://<hostname>:<port>)

For the base class, this just returns [].

getSRMs(self)

source code 

Return a list of dictionaries containing information about the SRM endpoints.

Each dictionary must have the following keys:

  • acbr
  • status
  • version
  • endptoin
  • name

The base class implementation uses the following configuration entries (default value in parenthesis)

  • se.srm_host (default: UNKNOWN.example.com)
  • se.srm_version (2.2.0)
  • se.srm_port (8443)
  • se.srm_endpoint (httpg://(se.srm_host):(se.srm_port)/srm/managerv2)

getName(self)

source code 

Return the name of the SE.

The base class uses the value of se.name in the configuration object.

getUniqueID(self)

source code 

Return the unique ID of the SE.

The base class uses the value of se.unique_name (defaults to se.name) in the configuraiton object.

getStatus(self)

source code 

Return the status of the SE.

The base classes uses the value of se.status (defaults to Production) in the configuration object.

getImplementation(self)

source code 

Return the implementation name for this SE.

The base class uses the value of se.implementation (defaults to UNKNOWN) in the configuration object.

getVersion(self)

source code 

Return a version string for this SE.

The base class uses the value of se.version (defaults to UNKNOWN) in the configuration object.

getSESpace(self, gb=False, total=False)

source code 

Returns information about the SE disk space.

See Also: getSESpace (module-level implementation)

getSETape(self)

source code 

Retrieve the freespace information from the tape systems.

See Also: getSETape (module level implementation)

getSEArch(self)

source code 

Returns the SE architecture.

This is an enumeration; the possible values are "tape", "multi-disk", "disk", or "other".

The base class makes an educated guess based upon the implementation name and the return value of hasTape.

getSAs(self)

source code 

Return a list of storage areas at this site.

For each storage area, we have a dictionary with the following keys:

Required:

  • saLocalID
  • path
  • acbr

Optional (default):

  • root (/)
  • filetype (permanent)
  • saName (saLocalID)
  • totalOnline; in GB (0)
  • usedOnline; in GB (0)
  • freeOnline; in GB (0)
  • reservedOnline; in GB (0)
  • totalNearline; in GB (0)
  • usedNearline; in GB (0)
  • freeNearline; in GB (0)
  • reservedNearline; in GB (0)
  • retention (replica)
  • accessLatency (online)
  • expiration (neverExpire)
  • availableSpace; in KB (0)
  • usedSpace; in KB (0)
Returns:
List of dictionaries containing SA info.

getVOInfos(self)

source code 

Return a list of VOInfo dictionaries.

Each dictionary must have the following keys:

  • voInfoID
  • name
  • path
  • tag
  • acbr
  • saLocalID

getPathForSA(self, space=None, vo=None, return_default=True, section='se')

source code 

Return a path appropriate for a VO and space.

Based upon the configuration info and the VO/space requested, determine
a path they should use.

This function tries to find option dcache.space_<space>_path; it parses
this as a comma-separated list of VO:path pairs; i.e., 
    space_CMS_path=cms:/dev/null, atlas:/pnfs/blah

If that does not provide a match and return_default is true, then it will
look for dcache.space_<space>_default_path and return that.

If that is not there and return_default is true, it will use the standard
getPath from gip_storage.

If return_default is true, this is guaranteed to return a non-empty
string; if return_default is false, then this might through a ValueError
exception.

@param cp: Site config object
@param space: The name of the space to determine the path for.
@param vo: The name of the VO which will be using this space; None for
    the default information.
@kw return_default: Set to True if you want this function to return the
    default path if it cannot find a VO-specific one.
@returns: A path string; raises a ValueError if return_default=False