-
Notifications
You must be signed in to change notification settings - Fork 2
/
ldap_requests_glue1.txt
113 lines (74 loc) · 6.28 KB
/
ldap_requests_glue1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
=============================== Usual LDAP requests ===================================
# ldapsearch command options:
# -s base|one|sub|children: Specify the scope of the search to be one of base, one, sub, or children to specify a base object, one-level, subtree, or children search. The default is sub.
# -L: Search results are displayed in LDAP Data Interchange Format detailed in ldif(5). A single -L restricts the output to LDIFv1. A second -L disables comments. A third -L disables printing of the LDIF version. The default is to use an extended version of LDIF.
# -H ldapuri: Specify URI(s) referring to the ldap server(s); only the protocol/host/port fields are allowed; a list of URI, separated by whitespace or commas is expected.
# -b searchbase: Use searchbase as the starting point for the search instead of the default.
alias ldapsearch='ldapsearch -x -LLL -s sub -H ldap://cclcgtopbdii01.in2p3.fr:2170 -b mds-vo-name=local,o=grid'
SE=ccsrm02.in2p3.fr
CE=sbgce2.in2p3.fr
SITE=IN2P3-CC
VO=biomed
# List all sites
ldapsearch "(&(ObjectClass=GlueSite))" GlueSiteUniqueID GlueSiteName
# Get the list of site names
ldapsearch "(&(ObjectClass=GlueSite))" GlueSiteUniqueID | egrep "^GlueSiteUniqueID" | awk --field-separator ": " '{print $2}' | uniq
# Get the site names from the GlueSE foreignkey
ldapsearch "(&(ObjectClass=GlueSE))" GlueForeignKey | grep GlueForeignKey | awk --field-separator "=" '{print $2}' | sort | uniq
#----------------------------------------------------------
# Queries about storage elements (GlueSE, GlueSA, VOInfo, GlueService)
#----------------------------------------------------------
#--- Find all SEs for on one site
ldapsearch "(&(ObjectClass=GlueSE)(GlueForeignKey=GlueSiteUniqueID=$SITE))" GlueSEUniqueID
#--- Find all SEs of type Storm or dCache
ldapsearch "(&(ObjectClass=GlueSE)(|(GlueSEImplementationName=StoRM)(GlueSEImplementationName=dCache)))" GlueSEUniqueID | egrep "^GlueSEUniqueID"
#--- Get details of one SE
ldapsearch "(&(ObjectClass=GlueSE)(GlueSEUniqueID=${SE}))"
#--- Find Storage Areas (GlueSA) that support the VO
ldapsearch "(&(ObjectClass=GlueSA)(GlueChunkKey=GlueSEUniqueID=${SE})(GlueSAAccessControlBaseRule=*${VO}*))"
#--- Find VOInfo elements of an SE, supporting biomed VO
ldapsearch "(&(objectclass=GlueVOInfo)(GlueChunkKey=GlueSEUniqueID=${SE})(GlueVOInfoAccessControlBaseRule=*${VO}*))"
#--- Find the service endpoint elements of an SE, supporting the VO
ldapsearch "(&(ObjectClass=GlueService)(GlueServiceUniqueID=*${SE}*)(GlueServiceAccessControlBaseRule=*${VO}*)(GlueServiceType=SRM)(GlueServiceVersion=2*))" GlueServiceType GlueServiceVersion GlueServiceUniqueID GlueServiceAccessControlRule
#--- Find the protocols supported by the endpoint
ldapsearch "(&(ObjectClass=GlueSEAccessProtocol)(GlueChunkKey=GlueSEUniqueID=${SE}))" GlueSEAccessProtocolLocalID GlueSEAccessProtocolType GlueSEAccessProtocolEndpoint
#--- Find the file access endpoint supporting gsftp
ldapsearch "(&(ObjectClass=GlueSEAccessProtocol)(GlueChunkKey=GlueSEUniqueID=${SE})(GlueSEAccessProtocolType=gsiftp))" GlueSEAccessProtocolEndpoint
#--- Find the control endpoint supporting gsftp
ldapsearch "(&(ObjectClass=GlueSEControlProtocol)(GlueChunkKey=GlueSEUniqueID=${SE}))"
#----------------------------------------------------------
# Queries about computing elements
#----------------------------------------------------------
#--- Get details of one CE
ldapsearch "(&(ObjectClass=GlueCE)(GlueCEUniqueID=${CE}*)(GlueCEAccessControlBaseRule=*${VO}*))"
ldapsearch "(&(ObjectClass=GlueCE)(GlueCEUniqueID=${CE}:8443/cream-pbs-biomed))"
#--- Get the SE-CE binding info
ldapsearch "(&(ObjectClass=GlueCESEBind)(GlueCESEBindSEUniqueID=sbgse1.in2p3.fr))" GlueCESEBindCEUniqueID GlueCESEBindSEUniqueID
ldapsearch "(&(ObjectClass=GlueCE)(GlueCEUniqueID=${CE}*)(GlueCEAccessControlBaseRule=*${VO}*))" GlueCEInfoDefaultSE
#--- Get the CEs for which a SE is a close or default SE
ldapsearch "(|(&(ObjectClass=GlueCESEBind)(GlueCESEBindSEUniqueID=${SE}))(&(ObjectClass=GlueCE)(GlueCEInfoDefaultSE=${SE})))" GlueCEUniqueID GlueCESEBindCEUniqueID | egrep "^GlueCEUniqueID|^GlueCESEBindCEUniqueID"
#--- Get the VO specific stats of the queues that support biomed on a given CE
ldapsearch "(&(ObjectClass=GlueVOView)(GlueCEAccessControlBaseRule=*${VO}*)(GlueChunkKey=GlueCEUniqueID=${CE}*))"
#----------------------------------------------------------
# Queries to get all elements that support the biomed VO
#----------------------------------------------------------
#--- Find all GlueSA that support biomed VO
ldapsearch "(&(ObjectClass=GlueSA)(GlueSAAccessControlBaseRule=*${VO}*))" GlueChunkKey GlueSAPath GlueSATotalOnlineSize GlueSAUsedOnlineSize GlueSAFreeOnlineSize
=> the GlueChunkKey gives the GlueSEUniqueID
#--- Find the GlueSE by id
ldapsearch "(&(ObjectClass=GlueSE)(GlueSEUniqueID=ccsrm02.in2p3.fr))" GlueSEUniqueID GlueForeignKey GlueSEImplementationName GlueSEImplementationVersion GlueSEStatus
=> the GlueForeignKey gives the GlueSiteUniqueID
#--- Find all GlueCE that support biomed VO
ldapsearch "(&(ObjectClass=GlueCE)(GlueCEAccessControlBaseRule=VO:${VO}*))" GlueCEUniqueID GlueCEInfoHostName GlueCEImplementationName GlueCEImplementationVersion GlueCEStateStatus GlueForeignKey
=> GlueForeignKey gives the GlueClusterUniqueID
ldapsearch "(&(ObjectClass=GlueCluster)(GlueClusterUniqueID=${CE}))" GGlueClusterUniqueID GlueForeignKey
=> One of the GlueForeignKeys gives the GlueSiteUniqueID
#--- Find all WMSs that support biomed VO
ldapsearch "(&(ObjectClass=GlueService)(GlueServiceAccessControlBaseRule=*${VO}*)(GlueServiceType=org.glite.wms.WMProxy))" GlueServiceUniqueID GlueServiceVersion GlueServiceName GlueServiceStatus GlueServiceEndpoint GlueForeignKey
=> GlueForeignKey gives the GlueSiteUniqueID
#--- Find all LFCs that support biomed VO
ldapsearch "(&(ObjectClass=GlueService)(GlueServiceAccessControlBaseRule=*${VO}*)(GlueServiceType=lcg-file-catalog))" GlueServiceUniqueID GlueServiceVersion GlueServiceName GlueServiceStatus GlueServiceEndpoint GlueForeignKey
=> GlueForeignKey gives the GlueSiteUniqueID
#--- Find the VOMS that supports biomed VO
ldapsearch "(&(ObjectClass=GlueService)(GlueServiceAccessControlBaseRule=*${VO}*)(GlueServiceType=org.glite.voms))" GlueServiceUniqueID GlueServiceVersion GlueServiceName GlueServiceStatus GlueServiceEndpoint GlueForeignKey
=> GlueForeignKey gives the GlueSiteUniqueID