View the Directory Entries

You can use the GET method to view all entries in the directory.

The command examples use the URL structure:
http(s)://host:port/rest/v1/directory

See Send Requests.

This example shows how to view all the entries in the directory.

To view the entries, submit a request to the URL using the GET method.

http://host:port/rest/v1/directory/<directory entry DN>?scope=<scopetype>&(filter)=<filter>&attributes=<attributes>

You must pass the query parameters to view the entries within a directory.

Name Description

scope

Sets the scope for the search operation. Its value must be one of the following:

  • base. Searches only the entry specified by the --baseDN or -b option.

  • one. Searches only the entry specified by the --baseDN or -b option and its immediate children.

  • sub or subordinate. Searches the entire subtree whose base is the entry specified by the --baseDN or -b option. This is the default option when no --searchScope option is provided.

filter

Specify the conditions that the entries must meet to be returned to the client.

attribute

Specify the name of the attribute to sort the data

sizeLimit

Set the maximum number of matching entries that the directory server should return to the client. If this is not provided, then there will be no maximum requested by the client.

timeLimit

Sets the maximum length of time in seconds that the directory server should spend processing any search request. If this is not provided, no time limit is imposed by the client.

controls

Optional. Specify the LDAP controls for identifying the request control.

Example

curl -i -X GET -u cn=Directory Manager:******* -H Content-type:application/json http://myhost:7001/rest/v1/directory/ou=People,dc=example,dc=com?scope=sub&filter=(objectclass=*)&attributes=%2b

The following shows an example of the response, showing entries in the directory.

{
  "msgType": "urn:ietf:params:rest:schemas:oracle:oud:1.0:SearchResponse",
  "totalResults": 3,
  "searchResultEntries": [
    {
      "dn": "ou=People,dc=example,dc=com",
      "attributes": {
        "ou": "People",
        "objectClass": [
          "top",
          "organizationalunit"
        ]
      }
    },
    {
      "dn": "uid=user.1,ou=People,dc=example,dc=com",
      "attributes": {
        "mail": "user.1@example.com",
        "initials": "ALA",
        "homePhone": "+1 280 375 4325",
        "pager": "+1 850 883 8888",
        "givenName": "Aaren",
        "employeeNumber": "1",
        "telephoneNumber": "+1 390 103 6917",
        "mobile": "+1 680 734 6300",
        "sn": "Atp",
        "cn": "Aaren Atp",
        "userPassword": "{SSHA512}password",
        "description": "This is the description for Aaren Atp.",
        "street": "70110 Fourth Street",
        "st": "OH",
        "postalAddress": "Aaren Atp$70110 Fourth Street$New Haven, OH  93694",
        "l": "New Haven",
        "postalCode": "93694",
        "uid": "user.1",
        "objectClass": [
          "top",
          "inetorgperson",
          "organizationalperson",
          "person"
        ]
      }
    },
    {
      "dn": "uid=user.2,ou=People,dc=example,dc=com",
      "attributes": {
        "mail": "user.2@example.com",
        "initials": "AOA",
        "homePhone": "+1 003 428 0962",
        "pager": "+1 053 688 9803",
        "givenName": "Aarika",
        "employeeNumber": "2",
        "telephoneNumber": "+1 757 462 0301",
        "mobile": "+1 279 618 3901",
        "sn": "Atpco",
        "cn": "Aarika Atpco",
        "userPassword": "{SSHA512}/password",
        "description": "This is the description for Aarika Atpco.",
        "street": "00900 Maple Street",
        "st": "KS",
        "postalAddress": "Aarika Atpco$00900 Maple Street$New Orleans, KS  10857",
        "l": "New Orleans",
        "postalCode": "10857",
        "uid": "user.2",
        "objectClass": [
          "top",
          "inetorgperson",
          "organizationalperson",
          "person"
        ]
      }
    },
    {
      "dn": "uid=user.3,ou=People,dc=example,dc=com",
      "attributes": {
        "mail": "user.3@example.com",
        "initials": "AKA",
        "homePhone": "+1 332 432 4295",
        "pager": "+1 197 025 3730",
        "givenName": "Aaron",
        "employeeNumber": "3",
        "telephoneNumber": "+1 094 100 7524",
        "mobile": "+1 890 430 9077",
        "sn": "Atrc",
        "cn": "Aaron Atrc",
        "userPassword": "{SSHA512}password",
        "description": "This is the description for Aaron Atrc.",
        "street": "59748 Willow Street",
        "st": "TN",
        "postalAddress": "Aaron Atrc$59748 Willow Street$Green Bay, TN  66239",
        "l": "Green Bay",
        "postalCode": "66239",
        "uid": "user.3",
        "objectClass": [
          "top",
          "inetorgperson",
          "organizationalperson",
          "person"
        ]
      }
    }
  ]
}