Method Path Description
GET /v1/ldap_mappings Get all LDAP mappings
GET /v1/ldap_mappings/{uid} Get a single LDAP mapping
PUT /v1/ldap_mappings/{uid} Update an LDAP mapping
POST /v1/ldap_mappings Create a new LDAP mapping
DELETE /v1/ldap_mappings/{uid} Delete an LDAP mapping

Get all LDAP mappings

GET /v1/ldap_mappings

Get all LDAP mappings.

Required permissions

Permission name
view_all_ldap_mappings_info

Request

Example HTTP request

GET /ldap_mappings 

Request headers

Key Value Description
Host cnm.cluster.fqdn Domain name
Accept application/json Accepted media type

Response

Returns a JSON array of LDAP mapping objects.

Example JSON body

[
  {
     "uid": 17,
     "name": "Admins",
     "dn": "OU=ops.group,DC=redislabs,DC=com",
     "email": "[email protected]",
     "role_uids": ["1"],
     "email_alerts": true,
     "bdbs_email_alerts": ["1","2"],
     "cluster_email_alerts": true
  }
]

Status codes

Code Description
200 OK No error

Get LDAP mapping

GET /v1/ldap_mappings/{int: uid}

Get a specific LDAP mapping.

Required permissions

Permission name
view_ldap_mapping_info

Request

Example HTTP request

GET /ldap_mappings/1 

Request headers

Key Value Description
Host cnm.cluster.fqdn Domain name
Accept application/json Accepted media type

URL parameters

Field Type Description
uid integer The object’s unique ID.

Response

Returns an LDAP mapping object.

Example JSON body

{
     "uid": 17,
     "name": "Admins",
     "dn": "OU=ops.group,DC=redislabs,DC=com",
     "email": "[email protected]",
     "role_uids": ["1"],
     "email_alerts": true,
     "bdbs_email_alerts": ["1","2"],
     "cluster_email_alerts": true
}

Error codes

Possible error_code values:

Code Description
unsupported_resource The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.
ldap_mapping_not_exist An object does not exist

Status codes

Code Description
200 OK Success.
403 Forbidden Operation is forbidden.
404 Not Found ldap_mapping does not exist.
501 Not Implemented Cluster doesn’t support LDAP mappings yet.

Update LDAP mapping

PUT /v1/ldap_mappings/{int: uid}

Update an existing ldap_mapping object.

Required permissions

Permission name
update_ldap_mapping

Request

Example HTTP request

PUT /ldap_mappings/17 

Example JSON body

{
    "dn": "OU=ops,DC=redislabs,DC=com",
    "email": "[email protected]",
    "email_alerts": true,
    "bdbs_email_alerts": ["1","2"],
    "cluster_email_alerts": true
}

Request headers

Key Value Description
Host cnm.cluster.fqdn Domain name
Accept application/json Accepted media type

Request body

Include an LDAP mapping object with updated fields in the request body.

Response

Example JSON body

{
     "uid": 17,
     "name": "Admins",
     "dn": "OU=ops,DC=redislabs,DC=com",
     "email": "[email protected]",
     "role_uids": ["1"],
     "email_alerts": true,
     "bdbs_email_alerts": ["1","2"],
     "cluster_email_alerts": true
}

Error codes

Possible error_code values:

Code Description
unsupported_resource The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.
name_already_exists An object of the same type and name exists
ldap_mapping_not_exist An object does not exist
invalid_dn_param A dn parameter has an illegal value
invalid_name_param A name parameter has an illegal value
invalid_role_uids_param A role_uids parameter has an illegal value
invalid_account_id_param An account_id parameter has an illegal value

Status codes

Code Description
200 OK Success, LDAP mapping is created.
400 Bad Request Bad or missing configuration parameters.
404 Not Found Attempting to change a non-existing LDAP mapping.
501 Not Implemented Cluster doesn’t support LDAP mapping yet.

Create LDAP mapping

POST /v1/ldap_mappings

Create a new LDAP mapping.

Required permissions

Permission name
create_ldap_mapping

Request

Example HTTP request

POST /ldap_mappings 

Example JSON body

{
     "name": "Admins",
     "dn": "OU=ops.group,DC=redislabs,DC=com",
     "email": "[email protected]",
     "role_uids": ["1"]
}

Request headers

Key Value Description
Host cnm.cluster.fqdn Domain name
Accept application/json Accepted media type

Request body

Include an LDAP mapping object in the request body.

Response

Example JSON body

{
     "uid": 17,
     "name": "Admins",
     "dn": "OU=ops.group,DC=redislabs,DC=com",
     "email": "[email protected]",
     "role_uids": ["1"]
}

Error codes

Possible error_code values:

Code Description
unsupported_resource The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.
name_already_exists An object of the same type and name exists
missing_field A needed field is missing
invalid_dn_param A dn parameter has an illegal value
invalid_name_param A name parameter has an illegal value
invalid_role_uids_param A role_uids parameter has an illegal value

Status codes

Code Description
200 OK Success, an LDAP-mapping object is created.
400 Bad Request Bad or missing configuration parameters.
501 Not Implemented Cluster doesn’t support LDAP mappings yet.

Delete LDAP mapping

DELETE /v1/ldap_mappings/{int: uid}

Delete an LDAP mapping object.

Required permissions

Permission name
delete_ldap_mapping

Request

Example HTTP request

DELETE /ldap_mappings/1 

Request headers

Key Value Description
Host cnm.cluster.fqdn Domain name
Accept application/json Accepted media type

URL parameters

Field Type Description
uid integer The ldap_mapping unique ID.

Response

Returns a status code. If an error occurs, the response body may include a more specific error code and message.

Error codes

Possible error_code values:

Code Description
unsupported_resource The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.
ldap_mapping_not_exist An object does not exist

Status codes

Code Description
200 OK Success, the ldap_mapping is deleted.
406 Not Acceptable The request is not acceptable.
501 Not Implemented Cluster doesn’t support LDAP mappings yet.