Example #1
0
def getValidStatusTypes():
  '''
  Returns from the OperationsHelper: RSSConfiguration/GeneralConfig/Resources
  '''
  
  DEFAULTS = { 
               'Site'          : { 'StatusType' : "''" },
               'Service'       : { 'StatusType' : "''" },
               'Resource'      : { 'StatusType' : "''" },
               'StorageElement': { 'StatusType' : [ 'Read', 'Write', 'Remove', 'Check' ] }
              }
  
  opHelper = Operations()
  
  sections = opHelper.getSections( 'RSSConfiguration/GeneralConfig/Resources' )
  if not sections[ 'OK' ]:
    return DEFAULTS
  
  result = {}
  for section in sections[ 'Value' ]:
    res = opHelper.getValue( 'RSSConfiguration/GeneralConfig/Resources/%s/StatusType' % section )
    if res is None:
      if DEFAULTS.has_key( section ):
        result[ section ] = { 'StatusType' : DEFAULTS[ section ] }
      else:
        result[ section ] = { 'StatusType' : None }  
    else:
      result[ section ] = { 'StatusType' : Utils.getTypedList( res ) }
      
  return result     
Example #2
0
def getValidServiceTypes():
  '''
  Returns from the OperationsHelper: RSSConfiguration/GeneralConfig/ServiceType
  '''
  
  DEFAULTS = [ 'Computing', 'Storage', 'VO-BOX', 'VOMS', 'CondDB' ]
  
  result = Operations().getValue( 'RSSConfiguration/GeneralConfig/ServiceType' )
  if result is not None:
    return Utils.getTypedList( result )
  return DEFAULTS
Example #3
0
def getValidSiteTypes():
  '''
  Returns from the OperationsHelper: RSSConfiguration/GeneralConfig/SiteType
  '''
  
  DEFAULTS = [ 'T1', 'T2', 'T3', 'T4' ]
  
  result = Operations().getValue( 'RSSConfiguration/GeneralConfig/SiteType' )
  if result is not None:
    return Utils.getTypedList( result )
  return DEFAULTS
Example #4
0
def getValidPolicyResult():
  '''
  Returns from the OperationsHelper: RSSConfiguration/GeneralConfig/PolicyResult
  '''
  
  DEFAULTS = [ 'Error', 'Unknown', 'Banned', 'Probing', 'Bad', 'Active' ]
  
  result = Operations().getValue( 'RSSConfiguration/GeneralConfig/PolicyResult' )
  if result is not None:
    return Utils.getTypedList( result )
  return DEFAULTS
Example #5
0
def getValidStatus():
  '''
  Returns from the OperationsHelper: RSSConfiguration/GeneralConfig/Status
  '''
  
  DEFAULTS = [ 'Active', 'Bad', 'Probing', 'Banned' ]
  
  result = Operations().getValue( 'RSSConfiguration/GeneralConfig/Status' )
  if result is not None:
    return Utils.getTypedList( result )
  return DEFAULTS
Example #6
0
def getValidPolicyTypes():
  '''
  Returns from the OperationsHelper: RSSConfiguration/GeneralConfig/PolicyTypes
  '''
  
  DEFAULTS = [ 'Resource_PolType', 'Alarm_PolType', 'Collective_PolType', 'RealBan_PolType' ]
  
  result = Operations().getValue( 'RSSConfiguration/GeneralConfig/PolicyTypes' )
  if result is not None:
    return Utils.getTypedList( result )
  return DEFAULTS
Example #7
0
def getValidResourceTypes():
  '''
  Returns from the OperationsHelper: RSSConfiguration/GeneralConfig/ResourceType
  '''
  
  DEFAULTS = [ 'CE', 'CREAMCE', 'SE', 'LFC_C', 'LFC_L', 'FTS', 'VOMS' ]
  
  result = Operations().getValue( 'RSSConfiguration/GeneralConfig/ResourceType' )
  if result is not None:
    return Utils.getTypedList( result )
  return DEFAULTS
Example #8
0
def getValidElements():
  '''
  Returns from the OperationsHelper: RSSConfiguration/GeneralConfig/Granularity
  '''
  
  DEFAULTS = [ 'Site', 'Service', 'Resource', 'StorageElement' ]
  
  result = Operations().getValue( 'RSSConfiguration/GeneralConfig/Granularity' )
  if result is not None:
    return Utils.getTypedList( result )
  return DEFAULTS