Previous topic

AGIS API

Next topic

Site

TiersOfATLAS API

class agis.info._TiersOfATLAS.TiersOfATLAS

DQ2.info.TiersOfATLAS implementation based on AGIS API: agis.info.TiersOfATLAS.

Author :Alexey Anisenkov
Revision :$Id: _TiersOfATLAS.py 732 2012-09-07 10:17:49Z anisyonk $
__init__()

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

Methods

getActivities() Retrieve information about DDM Activities.
getActivity(activityId) Resolve DDM Activity name by given id.
getActivityId(activity) Resolve DDM activity id by name.
getAllActivities() Return list of DDM Activities.
getAllAliases() Retrieve list with all aliases: the list of DDMGroup names.
getAllDestinationSites() List all destination sites.
getAllPermissions() List all possible permission types.
getAllSources() List all source sites.
getCloseSites(id) Retrieve list of source sites which are close to given destination site.
getClouds() List of clouds names.
getConnectedSites(id) Alias for getCloseSites function.
getFQANsPerQuota(site) Retrieve fqans for which quota is defined.
getFTS(surl, site) Find FTS server serving source SURL to destination site.
getFederationsDictionary() Get dictionary with all ATLAS federations and its pledges.
getFederationsList() List all ATLAS federations.
getLocalCatalog(id) Find LFC endpoint for DDMEndpoint or Cloud or DDM virtual groups of sites.
getPermissions(site, permission) Return the list of FAQNs who have requested permission for given site.
getPhysicsgroups() List all ATLAS physics groups.
getPledges(federation[, year]) Retrieve information about pledges.
getProtocolPrefix(location, protocol) Retrieve prefix field of seinfo property associated with ddmendpoint.
getProtocolRegexp(location, protocol) Retrieve regexp field of seinfo property associated with ddmendpoint.
getProtocols(location) Retrieve protocol values for given location.
getQuota(site, faqn) Retrieve quota value associated with FAQN for given site.
getRemoteCatalogs(id) Retrieve list of LFC entries associated with site or cloud.
getSEInfoProperty(ddmendpoint) Retrieve seinfo property of DDMEndpoint object.
getSEType(location) Retrieve setype value for given location.
getShares() Retrieve DDM shares info.
getSiteAltName(ddmendpoint) Resolve ATLAS site name by DDMEndpoint name.
getSiteByCE(domain) Quick stub function for the compatibility with dq2.info.
getSiteDomainProperty(id) Retrieve domain property of DDMEndpoint object.
getSiteEmailProperty(id) Retrieve email property of Site object by given DDMEndpoint name.
getSiteFromSURL(surl) Give the location of a SURL.
getSiteProperty(id, property) Retrieve the property value for given site and property name.
getSiteSRMProperty(id) Retrieve SRM property associated with given DDMEndpoint
getSites(id) Resolve DDMGroup or DDMEndpoint itself to list of DDMEndpoint names.
getSitesDomainProperty() Retrieve domain property for each DDMEndpoint.
getSitesInCloud(cloud) List sites belong to given cloud identified by name or by 2-letter alias.
getSitesInFederation(federation) Retrieve list of ATLAS sites belong to given federation.
getSitesPermissions() Retrieve permissions data for each site.
getSitesSEinfo() Retrieve SE related information for each site.
getStorageInfo(cloud, closeSE) Retrieve list of storages with LFC endpoint associated.
getTier1s() Get list of Tier1s sites.
getTier1sInCloud(cloud) List Tier1s sites belong to given cloud.
getTier2s() Get list of Tier2s sites.
getTier3s() Get list of Tier3s sites.
getToolAssigner(id) Retrieve toolAssigner property of DDMEndpoint object.
getTransferTools(src, dst) Find transfer tools serving source src to destination site dst.
isSURLFromSiteOrCloud(surl, id) Check if given SURL matches the domain specified for the given site or cloud.
isTapeSite(site) Check if site is a tape storage.
listCEsInCloudByCloud(domain) Quick stub function for the compatibility with dq2.info.
listCEsInCloudByDomain(domain) Quick stub function for the compatibility with dq2.info.
listSpaceTokensPerSites() List space tokens names per DDMSite.
list_ddm_groups(**kwargs) Retrieve list of all DDMGroups with DDMEndpoints associated.
list_sites_ddmendpointnames(**kwargs) Retrieve list of DDMEndpoints.
resolveCloud(cloud) Resolve full cloud name by given 2-letters name.
resolveGOC(sites) Resolves a dictionary of ATLAS site names to their DDMEndpoint names.
whichCloud(site) Resolve cloud name by given ddmendpoint.
whichFederation(site) Resolve name of Regional Center to which given site belongs.
getActivities()

Retrieve information about DDM Activities.

Returns:Tuple with default activity, dictionary of activities
Return type:tuple
getActivity(activityId)

Resolve DDM Activity name by given id.

Parameters:activityId (string or int) – activity identification number
Returns:the activity name
getActivityId(activity)

Resolve DDM activity id by name.

Parameters:activity (string) – activity identifier (name)
Returns:the activityId or None if not found
Return type:int or None
getAllActivities()

Return list of DDM Activities.

Returns:list with all valid DDM Activity names
Return type:list
getAllAliases()

Retrieve list with all aliases: the list of DDMGroup names.

Returns:list of DDMGroup names
Return type:list
getAllDestinationSites()

List all destination sites.

Returns:list with all valid destination DDMEndpoint names
Return type:list
getAllPermissions()

List all possible permission types.

Example of permission type: ‘r’,’w’, etc

Returns:all the permissions
getAllSources()

List all source sites.

Returns:list with all valid source sites: list of DDMEndpoints + DDMGroup names
Return type:list
getCloseSites(id)

Retrieve list of source sites which are close to given destination site.

Parameters:id (string) – destination DDMendpoint name
Returns:list of source sites or or empty list if no close sites found
Return type:list
getClouds()

List of clouds names.

Returns:list of clouds
getConnectedSites(id)

Alias for getCloseSites function.

Refer to agis.info._TiersOfATLAS.TiersOfATLAS.getCloseSites for details.

getFQANsPerQuota(site)

Retrieve fqans for which quota is defined.

Parameters:site – DDMEndpoint name (the site identifier as appears in TiersOfATLAS)
Returns:the list of fqans for which a quota is defined.
getFTS(surl, site)

Find FTS server serving source SURL to destination site.

Parameters:
  • surl – the source SURL
  • site – the destination site.
Returns:

FTS endpoint or None

getFederationsDictionary()

Get dictionary with all ATLAS federations and its pledges.

Returns:{‘federation_name’:{‘sites’:[], ‘pledges’:[]}}
Return type:dict
getFederationsList()

List all ATLAS federations.

Returns:list federations names
getLocalCatalog(id)

Find LFC endpoint for DDMEndpoint or Cloud or DDM virtual groups of sites.

Parameters:id (string) – the DDMEndpoint or cloud identifier
Returns:endpoint or None
Return type:string or None
getPermissions(site, permission)

Return the list of FAQNs who have requested permission for given site.

None returned if permission not found.

Parameters:
  • site – DDMEndpoint name (the site identifier as appears in TiersOfATLAS)
  • permission – letter of permission like ‘r’,’w’, etc
Returns:

the list of FAQNs who have permission

Exception raised if site not exists.

getPhysicsgroups()

List all ATLAS physics groups.

Returns:list of physics groups names
getPledges(federation, year=None)

Retrieve information about pledges.

Parameters:
  • federation – name of Regional Center
  • year – the year for which to get pledge value
Returns:

if no year specified, return a dictionary with yearly pledges, if the year is specified, return directly the pledge

Return type:

dict or string

getProtocolPrefix(location, protocol)

Retrieve prefix field of seinfo property associated with ddmendpoint. Should be redisigned and reimplemented later.

Parameters:
  • location – DDMEndpoint name
  • protocol – name of protocol
Returns:

the prefix value for a protocol

Return type:

string

getProtocolRegexp(location, protocol)

Retrieve regexp field of seinfo property associated with ddmendpoint.

Should be redisigned and reimplemented later.

Parameters:
  • location – DDMEndpoint name
  • protocol – name of protocol
Returns:

the protocol regexp value for a protocol

getProtocols(location)

Retrieve protocol values for given location.

Should be redisigned and reimplemented later.

Parameters:location – DDMEndpoint name
Returns:the ordered list of protocols
getQuota(site, faqn)

Retrieve quota value associated with FAQN for given site.

Parameters:
  • site – DDMEndpoint name (the site identifier as appears in TiersOfATLAS)
  • faqn – the faqn identifier (role)
Returns:

the quota value in Tera

Exception raised if site name is invalid, None returned if quota not set.

getRemoteCatalogs(id)

Retrieve list of LFC entries associated with site or cloud.

If id is None return all LFC services.

Parameters:id – the site or cloud identifier as appears in TiersOfATLAS
Returns:list of LFC endpoints
getSEInfoProperty(ddmendpoint)

Retrieve seinfo property of DDMEndpoint object.

Parameters:id – DDMEndpoint name (the site identifier as appears in TiersOfATLAS)
Returns:the seinfo dict property
Return type:dict or None
getSEType(location)

Retrieve setype value for given location.

Should be redisigned and reimplemented later. Return se type: e.g. castor, dpm, dcache, etc.

Parameters:location – DDMEndpoint name
Returns:SE type value
getShares()

Retrieve DDM shares info.

Returns:Tuple with default share, dictionary of shares.
Return type:tuple
getSiteAltName(ddmendpoint)

Resolve ATLAS site name by DDMEndpoint name.

Backward-compatibility function.

Parameters:id – DDMEndpoint name
Returns:list of associated ATLAS site names
getSiteByCE(domain)

Quick stub function for the compatibility with dq2.info.

Should be deprecated.

Returns:None
getSiteDomainProperty(id)

Retrieve domain property of DDMEndpoint object.

Parameters:id – DDMEndpoint name
Returns:the domain pattern property
getSiteEmailProperty(id)

Retrieve email property of Site object by given DDMEndpoint name.

Parameters:id – DDMEndpoint name
Returns:email string value
getSiteFromSURL(surl)

Give the location of a SURL.

Parameters:surl (string) – source URL
Returns:the location corresponding to the SURL
Return type:string or None
getSiteProperty(id, property)

Retrieve the property value for given site and property name.

Allowed property names:
  • srm
  • email
  • seinfo
  • domain
  • alternateName
  • toolAssigner
Parameters:
  • id (string) – DDMEndpoint name (the site identifier as appears in TiersOfATLAS)
  • property (string) – property name
Returns:

property value or None

getSiteSRMProperty(id)

Retrieve SRM property associated with given DDMEndpoint

Parameters:id – DDMEndpoint name
Returns:srm entry in format: ‘token:token_name:srm_url’ or None
getSites(id)

Resolve DDMGroup or DDMEndpoint itself to list of DDMEndpoint names.

Try to guess id parameter as DDMGroup, Cloud, DDMEndpoint (in order of preference).

Parameters:id (string) – the DDMEndpoint or DDMGroup name as appears in TiersOfATLAS
Returns:list of DDMEndpoint names matching id or empty list otherwise
Return type:list
getSitesDomainProperty()

Retrieve domain property for each DDMEndpoint.

Returns:dict(‘DDMEndpoint’:’domain value’)
Return type:dictionary
getSitesInCloud(cloud)

List sites belong to given cloud identified by name or by 2-letter alias.

Example of cloud name and 2-letters alias: FRANCESITES/FR.

Parameters:cloud (string) – cloud identifier
Returns:a list of sites within the cloud
getSitesInFederation(federation)

Retrieve list of ATLAS sites belong to given federation.

Parameters:federation – federation name
Returns:list of ATLAS sites names
getSitesPermissions()

Retrieve permissions data for each site.

This function is simple wrapper for agis.api.AGIS.AGIS.list_ddmendpoints_permissions one to enable smart caching on client side.

getSitesSEinfo()

Retrieve SE related information for each site.

This function is simple wrapper for agis.api.AGIS.AGIS.list_ddmendpoints_seinfo one to enable smart caching on client side.

getStorageInfo(cloud, closeSE)

Retrieve list of storages with LFC endpoint associated.

This method returns the LFC that output files should be registered to and a list of storages to store output files in order of preference:

  • close SE if it is in the cloud
  • the cloud’s T1 disk SE
  • other SEs in the cloud
Parameters:
  • cloud – the destination cloud the task is assigned
  • closeSE – the hostname of the SE the task is actually running on
Returns:

a tuple (LFC endpoint, [list of storage endpoints])

Return type:

tuple

getTier1s()

Get list of Tier1s sites.

Returns:list with all Tier-1 DDMEndpoint names
Return type:list
getTier1sInCloud(cloud)

List Tier1s sites belong to given cloud.

Returns:list of Tier-1 DDMEndpoints in the given cloud
Return type:list
getTier2s()

Get list of Tier2s sites.

Returns:list with all Tier-2 DDMEndpoint names
Return type:list
getTier3s()

Get list of Tier3s sites.

Returns:list with all Tier-3 DDMEndpoint names
Return type:list
getToolAssigner(id)

Retrieve toolAssigner property of DDMEndpoint object.

Parameters:id – DDMEndpoint name
Returns:the site tool assigner or None if empty or not set.
getTransferTools(src, dst)

Find transfer tools serving source src to destination site dst.

Parameters:
  • src – the source site
  • dst – the destination site
Returns:

a dictionnary with all transfer tools and endpoint or None

Return type:

dict or None

isSURLFromSiteOrCloud(surl, id)

Check if given SURL matches the domain specified for the given site or cloud.

In case of cloud will need to resolve all sites within the cloud first.

Parameters:
  • surl (string) – source URL
  • id – the DDMendpoint or cloud or tier name identifier as appears in TiersOfATLAS.
Returns:

True in case SURL belongs to the site or to a cloud.

isTapeSite(site)

Check if site is a tape storage.

Parameters:site (string) – DDMEndpoint name
Returns:True if Tape storage, False otherwise.
listCEsInCloudByCloud(domain)

Quick stub function for the compatibility with dq2.info.

Should be deprecated.

Returns:empty list
listCEsInCloudByDomain(domain)

Quick stub function for the compatibility with dq2.info.

Should be deprecated.

Returns:empty list
listSpaceTokensPerSites()

List space tokens names per DDMSite.

Returns:the dictionnary {‘DDMSite’: [list of space tokens], ...}.
list_ddm_groups(**kwargs)

Retrieve list of all DDMGroups with DDMEndpoints associated.

Returns:list of names
Return type:list
list_sites_ddmendpointnames(**kwargs)

Retrieve list of DDMEndpoints. Exposed to improve performance by caching.

This function is simple wrapper for agis.api.AGIS.AGIS.list_sites_ddmendpointnames one to enable smart caching on client side.

resolveCloud(cloud)

Resolve full cloud name by given 2-letters name.

Parameters:cloud – 2-letter cloud name
Returns:full cloud name
resolveGOC(sites)

Resolves a dictionary of ATLAS site names to their DDMEndpoint names.

Parameters:sites (dict) – dictionary mapping of GOCDB/OIM sitename to None
Returns:filled copy of input dictionary : {‘ALTAS site’: [DDMEndpoint names] }
Return type:dict
Raise :TiersOfATLASException
whichCloud(site)

Resolve cloud name by given ddmendpoint. Return the full name of cloud (e.g. ‘FRANCESITES’) to which the site belongs.

Parameters:site – DDMEndpoint name
Returns:cloud name
whichFederation(site)

Resolve name of Regional Center to which given site belongs.

Parameters:site – DDMEndpoint name
Returns:federation name