MethodPathDescription
GET/v1/ldap_mappingsGet 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_mappingsCreate 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

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted 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": "ops.group@redislabs.com",
     "role_uids": ["1"],
     "email_alerts": true,
     "bdbs_email_alerts": ["1","2"],
     "cluster_email_alerts": true
  }
]

Status codes

CodeDescription
200 OKNo 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

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

URL parameters

FieldTypeDescription
uidintegerThe 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": "ops.group@redislabs.com",
     "role_uids": ["1"],
     "email_alerts": true,
     "bdbs_email_alerts": ["1","2"],
     "cluster_email_alerts": true
}

Error codes

Possible error_code values:

CodeDescription
unsupported_resourceThe 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_existAn object does not exist

Status codes

CodeDescription
200 OKSuccess.
403 ForbiddenOperation is forbidden.
404 Not Foundldap_mapping does not exist.
501 Not ImplementedCluster 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": "ops@redislabs.com",
    "email_alerts": true,
    "bdbs_email_alerts": ["1","2"],
    "cluster_email_alerts": true
}

Request headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted 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": "ops@redislabs.com",
     "role_uids": ["1"],
     "email_alerts": true,
     "bdbs_email_alerts": ["1","2"],
     "cluster_email_alerts": true
}

Error codes

Possible error_code values:

CodeDescription
unsupported_resourceThe 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_existsAn object of the same type and name exists
ldap_mapping_not_existAn object does not exist
invalid_dn_paramA dn parameter has an illegal value
invalid_name_paramA name parameter has an illegal value
invalid_role_uids_paramA role_uids parameter has an illegal value
invalid_account_id_paramAn account_id parameter has an illegal value

Status codes

CodeDescription
200 OKSuccess, LDAP mapping is created.
400 Bad RequestBad or missing configuration parameters.
404 Not FoundAttempting to change a non-existing LDAP mapping.
501 Not ImplementedCluster 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": "ops.group@redislabs.com",
     "role_uids": ["1"]
}

Request headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted 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": "ops.group@redislabs.com",
     "role_uids": ["1"]
}

Error codes

Possible error_code values:

CodeDescription
unsupported_resourceThe 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_existsAn object of the same type and name exists
missing_fieldA needed field is missing
invalid_dn_paramA dn parameter has an illegal value
invalid_name_paramA name parameter has an illegal value
invalid_role_uids_paramA role_uids parameter has an illegal value

Status codes

CodeDescription
200 OKSuccess, an LDAP-mapping object is created.
400 Bad RequestBad or missing configuration parameters.
501 Not ImplementedCluster 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

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

URL parameters

FieldTypeDescription
uidintegerThe 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:

CodeDescription
unsupported_resourceThe 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_existAn object does not exist

Status codes

CodeDescription
200 OKSuccess, the ldap_mapping is deleted.
406 Not AcceptableThe request is not acceptable.
501 Not ImplementedCluster doesn’t support LDAP mappings yet.