Difference between revisions of "stoney core: Search Resource Mapping (REST - LDAP)"
[unchecked revision] | [unchecked revision] |
(→Global Search Response Object (stoney core: Resellers Resource)) |
(→Global Search Response Object (stoney core: Resellers Resource)) |
||
Line 24: | Line 24: | ||
* localityName (localityName) | * localityName (localityName) | ||
− | The following sequence describes the resellers search: | + | === Sequence ==== |
− | + | The following sequence describes the resellers search. | |
+ | |||
+ | ==== Search for the entered string ==== | ||
+ | We presume, that the entered string is '''res''' (scope is one): | ||
+ | <pre> | ||
+ | ldapsearch -H ldaps://ldapm.stoney-cloud.org \ | ||
-b "ou=reseller,dc=stoney-cloud,dc=org" \ | -b "ou=reseller,dc=stoney-cloud,dc=org" \ | ||
-s one \ | -s one \ | ||
Line 31: | Line 36: | ||
-W -x -LLL \ | -W -x -LLL \ | ||
"(|(uid=*res*)(organizationName=*res*))" uid sstIsCompany sstIsActive organizationName</code> | "(|(uid=*res*)(organizationName=*res*))" uid sstIsCompany sstIsActive organizationName</code> | ||
+ | <pre> | ||
+ | A possible answer could look as follows: | ||
+ | <pre> | ||
+ | dn: uid=4000000,ou=reseller,dc=stoney-cloud,dc=org | ||
+ | uid: 4000000 | ||
+ | o: Reseller Ltd. | ||
+ | sstIsCompany: TRUE | ||
+ | sstIsActive: TRUE | ||
+ | </pre> | ||
+ | |||
+ | ==== Create a second search for each result ==== | ||
+ | As some of the attributes we're interested in are in the address sub tree, we need to execute a second search (scope is base): | ||
+ | <pre> | ||
+ | ldapsearch -H ldaps://ldapm.stoney-cloud.org \ | ||
+ | -b "ou=address,uid=4000000,ou=reseller,dc=stoney-cloud,dc=org" \ | ||
+ | -s base \ | ||
+ | -D "cn=Manager,dc=stoney-cloud,dc=org" \ | ||
+ | -W -x -LLL \ | ||
+ | "(objectclass=*)" countryName postalCode localityName | ||
+ | </pre> | ||
+ | <pre> | ||
+ | dn: ou=address,uid=4000000,ou=reseller,dc=stoney-cloud,dc=org | ||
+ | c: CH | ||
+ | postalCode: Postal Code | ||
+ | l: Locality | ||
+ | </pre> | ||
=== Global Search Response Object (stoney core: Resellers Resource) Mapping === | === Global Search Response Object (stoney core: Resellers Resource) Mapping === |
Revision as of 17:28, 14 May 2014
Also visit stoney core: Search Resource - REST API and stoney core: Global Searches.
Contents
Overview
stoney core: search resource methods
Global Search (GET)
The global search only incorporates a subset of attributes in the search. Detailed examples are described under stoney core: Global Searches.
Global Search Response Object (stoney core: Resellers Resource)
All the resellers are stored under the sub tree ou=reseller,dc=stoney-cloud,dc=org. The actual LDIF of a reseller is described under Reseller uid (per Reseller).
The following LDAP attributes must be included in the search:
- uid (id)
- organizationName (resellerName)
The following LDAP attributes must be returned:
- uid (id)
- sstIsCompany (isCompany)
- sstIsActive (isActive)
- organizationName (resellerName)
- countryName (countryCode)
- postalCode (postalCode)
- localityName (localityName)
Sequence =
The following sequence describes the resellers search.
Search for the entered string
We presume, that the entered string is res (scope is one):
ldapsearch -H ldaps://ldapm.stoney-cloud.org \ -b "ou=reseller,dc=stoney-cloud,dc=org" \ -s one \ -D "cn=Manager,dc=stoney-cloud,dc=org" \ -W -x -LLL \ "(|(uid=*res*)(organizationName=*res*))" uid sstIsCompany sstIsActive organizationName</code> <pre> A possible answer could look as follows: <pre> dn: uid=4000000,ou=reseller,dc=stoney-cloud,dc=org uid: 4000000 o: Reseller Ltd. sstIsCompany: TRUE sstIsActive: TRUE
Create a second search for each result
As some of the attributes we're interested in are in the address sub tree, we need to execute a second search (scope is base):
ldapsearch -H ldaps://ldapm.stoney-cloud.org \ -b "ou=address,uid=4000000,ou=reseller,dc=stoney-cloud,dc=org" \ -s base \ -D "cn=Manager,dc=stoney-cloud,dc=org" \ -W -x -LLL \ "(objectclass=*)" countryName postalCode localityName
dn: ou=address,uid=4000000,ou=reseller,dc=stoney-cloud,dc=org c: CH postalCode: Postal Code l: Locality
Global Search Response Object (stoney core: Resellers Resource) Mapping
API Attribute | LDAP Attribute |
---|---|
id | uid |
isCompany | sstIsCompany |
isActive | sstIsActive |
countryCode | postalCode |
resellerName | organizationName |
resellerName | postalCode |
localityName | localityName |
Global Search Response Object (stoney core: Customers Resource)
The following sequence describes the customers search:
Global Search Response Object (stoney core: Customers Resource) Mapping
API Attribute | LDAP Attribute |
---|---|
id | uid |
user |
People Search (GET)
The following sequence describes the people search:
People Search (GET) Mapping
API Attribute | LDAP Attribute |
---|---|
id | uid |
user |