TIBCO Data Virtualization® > Business Directory REST API > Business Directory REST APIs > Domains
 
Domains
The following operations can be performed against the ldap domains defined in the Business Directory:
GET /domains
POST /domains
GET /domains/{domainNameString}/groups
POST /domains/{domainNameString}/groups
DELETE /domains/{domainNameString}/groups
PUT /domains/{domainName}
DELETE /domains/{domainName}
GET /domains
This API is used to retrieve the domains filtered by site or retrieve ldap domains defined by the BD administrator of this business directory instance.
Parameters
Name
Description
Parameter Type
Data Type
site
Filter domains by site. If not specified, then only ldap domains will be returned.
query
string
Example to list domains for site 'test_site'
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/domains?site=test_site"
Example to list domains for site 'test_site' as ldap user with BD_ADMIN rights
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/domains?site=test_site"
Example to only get ldap domains defined within business directory
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/domains"
Example to get count of all domains for site 'test_site'
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/domains?site=test_site&count"
Example to only get count of ldap domains defined within business directory
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/domains?count"
POST /domains
This API is used to create a new ldap domain within Business Directory.
Parameters
None
Request Body
{
"name": "string",
"type": "OTHER",
"url": "string",
"login": "string",
"password": "string",
"clearpassword": "string",
"authentication": "string",
"validation": "TRUE",
"annotation": "string",
"typeString": "string",
"authenticationType": "Simple"
}
Example to add a ldap domain named my_bd_ldap_domain
curl -X POST -u admin:admin "https://localhost:9502/rest/v2/domains" -H "Content-Type:application/json" -d "{ \"name\" : \"my_bd_ldap_domain\", \"type\" : \"Other\", \"url\" : \"ldap://172.23.7.75:389/dc=composite,dc=com\", \"login\" : \"cn=Directory Manager\", \"password\" : \"DB63C710940F3BC2045CEDEFFF506F24\", \"clearpassword\" : \"\", \"authentication\" : \"Simple\", \"validation\" : \"TRUE\" }"
Example to add a ldap domain named my_bd_ldap_domain (as preexisting ldap user of domain 'ldapDomain' with BD_ADMIN rights)
curl -X POST -u user@ldapDomain:password "https://localhost:9502/rest/v2/domains" -H "Content-Type:application/json" -d "{ \"name\" : \"my_bd_ldap_domain\", \"type\" : \"Other\", \"url\" : \"ldap://172.23.7.75:389/dc=composite,dc=com\", \"login\" : \"cn=Directory Manager\", \"password\" : \"DB63C710940F3BC2045CEDEFFF506F24\", \"clearpassword\" : \"\", \"authentication\" : \"Simple\", \"validation\" : \"TRUE\" }"
Example to add a ldap domain with a password in the clear
curl -X POST -u admin:admin "https://localhost:9502/rest/v2/domains" -H "Content-Type:application/json" -d "{ \"name\" : \"my_bd_ldap_domain\", \"type\" : \"Other\", \"url\" : \"ldap://172.23.7.75:389/dc=composite,dc=com\", \"login\" : \"cn=Directory Manager\", \"password\" : \"\", \"clearpassword\" : \"directory\", \"authentication\" : \"Simple\", \"validation\" : \"TRUE\" }"
GET /domains/{domainNameString}/groups
This API is used to contact the ldap server and retrieve all groups. This will retrieve all groups regardless if the group already exists in Business Directory or not.
Parameters
Name
Description
Parameter Type
Data Type
domainNameString
the name of the ldap domain
path
string
Example to retrieve all ldap groups in an existing ldap domain 'my_bd_ldap_domain'.
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain/groups"
Example to retrieve all ldap groups in an existing ldap domain 'my_bd_ldap_domain' as ldap user with BD_ADMIN rights
curl -X GET -u user@my_bd_ldap_domain:password "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain/groups"
POST /domains/{domainNameString}/groups
This API is used to add external groups to a ldap domain. If the specified group has already been added, an error will result. If the specified group does not exist in the remote ldap server, an error will result. The provided JSON should be a list of group names to add to the ldap domain.
Parameters
Name
Description
Parameter Type
Data Type
domainNameString
the ldap domainbe modifiedto
path
string
Request Body
[
"string"
]
Example to add ldap groups in an existing ldap domain 'my_bd_ldap_domain'.
curl -X POST -u admin:admin "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain/groups" -H "Content-Type:application/json" -d "[\"buffy\", \"smallville\" ]"
Example to add ldap groups in an existing ldap domain 'my_bd_ldap_domain' as ldap user with BD_ADMIN rights.
curl -X POST -u user@my_bd_ldap_domain:password "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain/groups" -H "Content-Type:application/json" -d "[\"buffy\", \"smallville\" ]"
DELETE /domains/{domainNameString}/groups
This API is used to delete external groups from a ldap domain. If the specified group has not already been added, an error will result. The provided JSON should be a list of groups to remove from the domain.
Parameters
Name
Description
Parameter Type
Data Type
domainNameString
the ldap domain from which groups are to be deleted
path
string
Request Body
[
"string"
]
Example to remove ldap groups from an existing ldap domain 'my_bd_ldap_domain'.
curl -X DELETE -u admin:admin "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain/groups" -H "Content-Type:application/json" -d "[\"buffy\", \"smallville\" ]"
Example to remove ldap groups from an existing ldap domain 'my_bd_ldap_domain' as ldap user with BD_ADMIN rights
curl -X DELETE -u user@my_bd_ldap_domain:password "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain/groups" -H "Content-Type:application/json" -d "[\"buffy\", \"smallville\" ]"
Example to remove ldap groups from an existing ldap domain 'my_bd_ldap_domain' with X-HTTP-Method-Override
curl -X POST -u admin:admin "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain/groups" -H "X-HTTP-Method-Override:DELETE" -H "Content-Type:application/json" -d "[\"buffy\", \"smallville\" ]"
PUT /domains/{domainName}
This API is used to update an LDAP domain within Business Directory.
Parameters
Name
Description
Parameter Type
Data Type
domainName
name of the ldap domain
path
string
Request Body
{
"name": "string",
"type": "OTHER",
"url": "string",
"login": "string",
"password": "string",
"clearpassword": "string",
"authentication": "string",
"validation": "TRUE",
"annotation": "string",
"typeString": "string",
"authenticationType": "Simple"
}
Example to update a ldap domain named my_bd_ldap_domain
curl -X PUT -u admin:admin "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain" -H "Content-Type:application/json" -d "{ \"name\" : \"my_bd_ldap_domain\", \"type\" : \"Other\", \"url\" : \"ldap://172.23.7.75:389/dc=composite,dc=com\", \"login\" : \"cn=Directory Manager\", \"password\" : \"DB63C710940F3BC2045CEDEFFF506F24\", \"clearpassword\" : \"\", \"authentication\" : \"Simple\", \"validation\" : \"TRUE\" }"
Example to update a ldap domain named my_bd_ldap_domain as ldap user with BD_ADMIN rights
curl -X PUT -u user@ldapDomain:password "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain" -H "Content-Type:application/json" -d "{ \"name\" : \"my_bd_ldap_domain\", \"type\" : \"Other\", \"url\" : \"ldap://172.23.7.75:389/dc=composite,dc=com\", \"login\" : \"cn=Directory Manager\", \"password\" : \"DB63C710940F3BC2045CEDEFFF506F24\", \"clearpassword\" : \"\", \"authentication\" : \"Simple\", \"validation\" : \"TRUE\" }"
Example to update a ldap domain with a password in the clear; do not validate
curl -X PUT -u admin:admin "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain" -H "Content-Type:application/json" -d "{ \"name\" : \"my_bd_ldap_domain\", \"type\" : \"Other\", \"url\" : \"ldap://172.23.7.75:389/dc=composite,dc=com\", \"login\" : \"cn=Directory Manager\", \"password\" : \"\", \"clearpassword\" : \"directory\", \"authentication\" : \"Simple\", \"validation\" : \"FALSE\" }"
DELETE /domains/{domainName}
This API is used to remove an ldap domain.
Parameters
Name
Description
Parameter Type
Data Type
domainName
the name of the ldap domain
path
string
Example to remove an existing ldap domain 'my_bd_ldap_domain'.
curl -X DELETE -u admin:admin "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain"
Example to remove an existing ldap domain 'my_bd_ldap_domain' as ldap user with BD_ADMIN rights
curl -X DELETE -u user@ldapDomain:password "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain"
Example to remove an existing ldap domain 'my_bd_ldap_domain' with X-HTTP-Method-Override
curl -X POST -u admin:admin -H "X-HTTP-Method-Override:DELETE" "https://localhost:9502/rest/v2/domains/my_bd_ldap_domain"