Changes

stoney core: Global Searches

1,176 bytes added, 10:51, 25 May 2014
/* Alphanumerical value (non-integer) Reseller Search */
Also visit [[stoney core: Search Resource - REST API]] and [[stoney core: Search Resource Mapping (REST - LDAP)]].
 
= Overview =
The main search field in the upper right corner searches the whole directory and gives first results while typing (actual search starts after entering three characters). The following example shows, that after typing four letters, we have four results (each containing the first four letters “Müll”“step”):* Two customers “Peter Müller” and “Stefan Müller”.* One reseller “Müller & Co GmbH”[[Image:Search.png]]* One service “Online Backup 10 Gigabyte (Hausi Müller)”.
== Search Selection ==
== Reseller Search ==
=== Numerical value (integer) Reseller Search ===
The following example shows you the numerical value (integer) search (uid search) with '''400''' (400*) as the search parameter and the attributes '''o''' (for the organisation) and '''sstIsActive''' as the return values(the size limit is set to 5):
<pre>
ldapsearch -H ldaps://ldapm.tombstonestoney-cloud.ch org \ -b "ou=reseller,dc=fossstoney-cloud,dc=org" \
-s one \
-D "cn=Manager,dc=fossstoney-cloud,dc=org" \ -z 5 \
-W -x -LLL \
"(uid=*400*)" o sstIsActive
</pre>
The result(s):
<pre>
dn: uid=4000000,ou=reseller,dc=fossstoney-cloud,dc=orgo: Reseller Ltd.
sstIsActive: TRUE
o: stepping stone GmbH
</pre>
-D: binddn
Use the Distinguished Name binddn to bind to the LDAP directory.
-z sizelimit
retrieve at most sizelimit entries for a search. A sizelimit of
0 (zero) or none means no limit. A sizelimit of max means the
maximum integer allowable by the protocol. A server may impose
a maximal sizelimit which only the root user may override.
-W: Prompt for simple authentication. This is used instead of spec-
ifying the password on the command line.
=== Alphanumerical value (non-integer) Reseller Search ===
The following example shows you the alphanumerical value (non-integer) search with '''resste''' (res*ste*) as the search parameter and the attributes '''o''' (for the organisation) and '''sstIsActive''' as the return values(the size limit is set to 5):
<pre>
ldapsearch -H ldaps://ldapm.tombstonestoney-cloud.ch org \ -b "ou=reseller,dc=fossstoney-cloud,dc=org" \
-s one \
-D "cn=Manager,dc=fossstoney-cloud,dc=org" \ -z 5 \
-W -x -LLL \
"(o=res*ste*)" o sstIsActive
</pre>
The result(s):
<pre>
dn: uid=4000000,ou=reseller,dc=fossstoney-cloud,dc=orgo: Reseller Ltd.
sstIsActive: TRUE
o: stepping stone GmbH
</pre>
=== Numerical value (integer) Customer Search ===
The following example shows you the numerical value (integer) search (uid search) with '''400''' (400*) as the search parameter and the attributes '''o''' (for the organisation) and '''sstIsActive''' as the return values(the size limit is set to 5):
<pre>
ldapsearch -H ldaps://ldapm.tombstonestoney-cloud.ch org \ -b "ou=customers,dc=fossstoney-cloud,dc=org" \
-s one \
-D "cn=Manager,dc=fossstoney-cloud,dc=org" \ -z 5 \
-W -x -LLL \
"(&(sstBelongsToResellerUID=4000000)(|(uid=*400*)(sstExternalID=*400*)))" o sn givenName sstIsActivesstExternalID
</pre>
The result(s):
<pre>
dn: uid=4000001,ou=customers,dc=fossstoney-cloud,dc=orgo: Customer Ltd.
sstIsActive: TRUE
o: stepping stone GmbH
sstExternalID: 40013
 
dn: uid=4000083,ou=customers,dc=stoney-cloud,dc=org
sstIsActive: TRUE
o: DEVROOM
</pre>
=== Alphanumerical value (non-integer) Customer Search ===
The following example shows you the alphanumerical value (non-integer) search with '''cusste''' (cus*ste*) as the search parameter and the attributes '''o''' (for the organisation), '''givenName''', '''sn''' (surname) and '''sstIsActive''' as the return values(the size limit is set to 5):
<pre>
ldapsearch -H ldaps://ldapm.tombstonestoney-cloud.ch org \ -b "ou=customers,dc=fossstoney-cloud,dc=org" \
-s one \
-D "cn=Manager,dc=fossstoney-cloud,dc=org" \ -z 5 \
-W -x -LLL \
"(&(sstBelongsToResellerUID=4000000)(|(o=cus*ste*)(sn=cus*ste*)(givenName=cus*ste*)(sstExternalID=*400*)))" o givenName sn sstIsActivesstExternalID
</pre>
The result(s):
<pre>
dn: uid=4000001,ou=customers,dc=fossstoney-cloud,dc=orgo: Customer Ltd.sstIsActive: TRUE dn: uid=5000001,ou=customers,dc=foss-cloud,dc=orggivenName: Name
sstIsActive: TRUE
sno: Customerstepping stone GmbHsstExternalID: 40013
</pre>
== Person (People) Search ==
=== Numerical value (integer) People Search ===
The following example shows you the numerical value (integer) search (uid search) with '''400''' (*400*) as the search parameter and the attributes '''o''' (for the organisation) and '''sstIsActive''' as the return values(the size limit is set to 5):
<pre>
ldapsearch -H ldaps://ldapm.tombstonestoney-cloud.ch org \ -b "ou=people,dc=fossstoney-cloud,dc=org" \
-s one \
-D "cn=Manager,dc=fossstoney-cloud,dc=org" \ -z 5 \
-W -x -LLL \
"(&(sstBelongsToResellerUID=4000000)(uid=*400*))" o sn givenName sstIsActive
</pre>
The result(s):
<pre>
dn: uid=4000002,ou=people,dc=fossstoney-cloud,dc=org
givenName: Michael
sn: Eichenberger
sstIsActive: TRUE
dn: uid=4000064,ou=people,dc=fossstoney-cloud,dc=org
givenName: Christian
sn: Wittkowski
sstIsActive: TRUE
dn: uid=4000066,ou=people,dc=fossstoney-cloud,dc=org
givenName: Stijn
sn: Van Paesschen
sstIsActive: FALSE
dn: uid=4000069,ou=people,dc=fossstoney-cloud,dc=org
givenName: Jan
sn: Guldentops
sstIsActive: FALSE
 
dn: uid=4000080,ou=people,dc=stoney-cloud,dc=org
givenName: Tatiana
sn: Eichenberger
sstIsActive: TRUE
</pre>
=== Alphanumerical value (non-integer) People Search ===
The following example shows you the alphanumerical value (non-integer) search with '''mic''' (*mic*) as the search parameter and the attributes '''o''' (for the organisation), '''givenName''', '''sn''' (surname) and '''sstIsActive''' as the return values(the size limit is set to 5):
<pre>
ldapsearch -H ldaps://ldapm.tombstonestoney-cloud.ch org \ -b "ou=people,dc=fossstoney-cloud,dc=org" \
-s one \
-D "cn=Manager,dc=fossstoney-cloud,dc=org" \ -z 5 \
-W -x -LLL \
"(&(sstBelongsToResellerUID=4000000)(|(o=*mic*)(sn=*mic*)(givenName=*mic*)))" o givenName sn sstIsActive
</pre>
The result(s):
<pre>
dn: uid=4000002,ou=people,dc=fossstoney-cloud,dc=org
givenName: Michael
sn: Eichenberger
sstIsActive: TRUE
</pre>
=== Backup ===
==== Numerical value (integer) Backup Search ====
The following example shows you the alphanumerical numerical value (non-integer) search (uid search) with '''mic372''' (*mic372*) as the search parameter and the attributes '''uid''' (for the backup account uid), '''cn''' (common name, normally a combination of givenName and surname), '''gecos''' (the backup name), '''sstQuota''' and '''sstIsActive''' as the return values(the size limit is set to 5):
<pre>
ldapsearch -H ldaps://ldapm.tombstonestoney-cloud.ch org \ -b "ou=backup,ou=services,dc=fossstoney-cloud,dc=org" \
-s sub \
-D "cn=Manager,dc=fossstoney-cloud,dc=org" \ -z 5 \
-W -x -LLL \
"(&(sstBelongsToResellerUID=4000000)(uid=*372*))" uid cn gecos sstQuota sstIsActive
</pre>
Do not forget to restrict the search according to the person who is currently logged in.
 
The result(s):
<pre>
dn: uid=3723707,ou=accounts,ou=backup,ou=services,dc=stoney-cloud,dc=org
uid: 3723707
gecos: Michael Eichenberger
sstIsActive: TRUE
sstQuota: 10737418240
 
dn: uid=3723708,ou=accounts,ou=backup,ou=services,dc=stoney-cloud,dc=org
uid: 3723708
gecos: Christian Wittkowski
sstIsActive: TRUE
sstQuota: 10737418240
</pre>
==== Alphanumerical value (non-integer) Backup Search ====
The following example shows you the alphanumerical value (non-integer) search with '''mic''' (*mic*) as the search parameter and the attributes '''uid''' (for the backup account uid), '''cn''' (common name, normally a combination of givenName and surname), '''gecos''' (the backup name), '''sstQuota''' and '''sstIsActive''' as the return values(the size limit is set to 5):
<pre>
ldapsearch -H ldaps://ldapm.tombstonestoney-cloud.ch org \ -b "ou=backup,ou=services,dc=fossstoney-cloud,dc=org" \
-s sub \
-D "cn=Manager,dc=fossstoney-cloud,dc=org" \ -z 5 \
-W -x -LLL \
"(&(sstBelongsToResellerUID=4000000)(|(cn=*mic*)(gecos=*mic*)(givenName=*mic*)))" uid cn gecos sstQuota sstIsActive
</pre>
The result(s):
<pre>
dn: uid=3723707,ou=accounts,ou=backup,ou=services,dc=fossstoney-cloud,dc=org
uid: 3723707
cn: Michael Eichenberger
gecos: Michael Eichenberger
sstIsActive: TRUE
[[Category:Selfcarestoney core]][[Category:OpenLDAP directory]]
SLB, editor, reviewer
3,388
edits