Change an RDN

You can use the PATCH method to change the Relative Distinguished Name (RDN).

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

See Send Requests.

This example shows how to add a new RDN uid=Marcia Garza and delete the old RDN.

To change the RDN, submit a request to http://host:port/rest/v1/directory/<directory entry DN> using the PATCH method with the following payload:

{
  "msgType": "urn:ietf:params:rest:schemas:oracle:oud:1.0:ModifyDnRequest",
  "newRdn": "uid=Marcia Garza",
  "deleteOldRdn": true,
}

Example

curl -i -X PATCH -u cn=Directory Manager:*******  -H Content-type:application/json http://myhost:7001/rest/v1/directory/uid=mgarza,ou=People,dc=example,dc=com

If successful, the response body returns a status code of 200.

HTTP/1.1 200 OK

The following shows an example of the response.

{
  "msgType": "urn:ietf:params:rest:schemas:oracle:oud:1.0:ModifyDnResponse",
  "totalResults": 1,
  "searchResultEntries": [
    {
      "dn": "uid=Marcia Garza,ou=People,dc=oracle,dc=com",
      "attributes": {
        "mail": "mgarza@example.com",
        "sn": "mgarza",
        "cn": "mgarza",
        "pager": "+91 111 111 1111",
        "givenName": "Marcia Garza",
        "userPassword": "{SSHA512}password",
        "street": "California",
        "uid": "Marcia Garza",
        "objectClass": [
          "top",
          "organizationalperson",
          "person",
          "inetorgperson"
        ]
      }
    }
  ]
}