Sites

The different REST API operations that can be performed on the Business Directory sites are:

GET /sites
POST /sites
GET /sites/{siteName}
PUT /sites/{siteName}
DELETE /sites/{siteName}
GET /sites/{siteName}/dataPreviewPermission
POST /sites/{siteName}/dataPreviewPermission
DELETE /sites/{siteName}/dataPreviewPermission
POST /sites/{siteName}/refresh
GET /sites/{siteName}/scheduledRefresh
PUT /sites/{siteName}/scheduledRefresh
DELETE /sites/{siteName}/scheduledRefresh

GET /sites

This API is used to fetch all sites.

Parameters

None

Example to list all sites

curl -X GET -u admin:admin "https://localhost:9502/rest/v2/sites/"

Example to list all sites as ldap user

curl -X GET -u user@ldapDomain:password "https://localhost:9502/ rest/v2/sites/"

Equivalent system query

curl -X GET -u admin:admin "https://localhost:9502/rest/v2/data/query" -H "query:select * from SYS_SITES" -H "standardSQL:true" -H "system:true"

Example to retrieve count of all sites.

curl -X GET -u admin:admin "https://localhost:9502/rest/v2/sites?count"

POST /sites

This API is used to add a site or sites.

Parameters

None

Request Body

[
  {
    "siteName": "string",
    "uri": "string",
    "domain": "string",
    "userName": "string",
    "password": "string",
    "annotation": "string",
    "status": "string",
    "modifyTime": 0,
    "taskId": "string",
    "async": true,
    "dataPreviewEnabled": true
  }
]

Example to create a new site

curl -X POST -u admin:admin "https://localhost:9502/rest/v2/sites" -H "Content-Type:application/json" -d "[{\"siteName\" : \"test_site\", \"uri\" : \"http://admin@localhost:9400\", \"domain\" : \"composite\", \"password\" : \"admin\", \"annotation\" : \"test site\", \"dataPreviewEnabled\" : false }]"

Example to create a new site as ldap user with BD_ADMIN rights

curl -X POST -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites" -H "Content-Type:application/json" -d "[{\"siteName\" : \"test_site\", \"uri\" : \"http://admin@localhost:9400\", \"domain\" : \"composite\", \"password\" : \"admin\", \"annotation\" : \"test site\", \"dataPreviewEnabled\" : false }]"

GET /sites/{siteName}

This API is used to fetch a single site.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

Example to list a single site

curl -X GET -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/"

Example to list a single site as ldap user

curl -X GET -u user@ldapDomain:password "https://localhost:9502/ rest/v2/sites/test_site/"

Equivalent system query

curl -X GET -u admin:admin "https://localhost:9502/rest/v2/data/query" -H "query:select * from SYS_SITES where SITE_NAME = 'test_site'" -H "standardSQL:true" -H "system:true"

PUT /sites/{siteName}

This API is update connection information for a site.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

Request Body

{
  "siteName": "string",
  "uri": "string",
  "domain": "string",
  "userName": "string",
  "password": "string",
  "annotation": "string",
  "status": "string",
  "modifyTime": 0,
  "taskId": "string",
  "async": true,
  "dataPreviewEnabled": true
}

Example to Update a site

curl -X PUT -u admin:admin "https://localhost:9502/rest/v2/sites/test_site" -H "Content-Type:application/json" -d "{\"siteName\" : \"test_site\", \"uri\" : \"http://admin@localhost:9400\", \"domain\" : \"composite\", \"password\" : \"admin\", \"annotation\" : \"new annotation (updated)\", \"dataPreviewEnabled\" : false }"

Example to Update a site as ldap user with BD_ADMIN rights

curl -X PUT -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites/test_site" -H "Content-Type:application/json" -d "{\"siteName\" : \"test_site\", \"uri\" : \"http://admin@localhost:9400\", \"domain\" : \"composite\", \"password\" : \"admin\", \"annotation\" : \"new annotation (updated)\", \"dataPreviewEnabled\" : false }"

Example to Update a site (X-HTTP-Method-Override)

curl -X POST -u admin:admin "https://localhost:9502/rest/v2/sites/test_site" -H "X-HTTP-Method-Override:PUT" -H "Content-Type:application/json" -d "{\"siteName\" : \"test_site\", \"uri\" : \"http://admin@localhost:9400\", \"domain\" : \"composite\", \"password\" : \"admin\", \"annotation\" : \"new annotation (updated)\", \"dataPreviewEnabled\" : false }"

DELETE /sites/{siteName}

This API is delete a site from Business Directory.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

Example to delete site 'test_site'

curl -X DELETE -u admin:admin "https://localhost:9502/rest/v2/sites/test_site"

Example to delete site 'test_site' (as ldap user with BD_ADMIN rights)

curl -X DELETE -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites/test_site"

Example to delete site 'test_site' (X-HTTP-Method-Override)

curl -X POST -u admin:admin "https://localhost:9502/rest/v2/sites/test_site" -H "X-HTTP-Method-Override:DELETE"

GET /sites/{siteName}/dataPreviewPermission

This API is get data preview enabled setting for a site.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

Example to get data preview enabled setting for a site

curl -X GET -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/dataPreviewPermission"

Example to get data preview enabled setting for a site as ldap user with BD_ADMIN rights

curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites/test_site/dataPreviewPermission"

POST /sites/{siteName}/dataPreviewPermission

This API is enable data preview for a site.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

async

 

query

string

Example to enable data preview for a site

curl -X POST -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/dataPreviewPermission"

Example to enable data preview for a site as ldap user with BD_ADMIN rights

curl -X POST -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites/test_site/dataPreviewPermission"

DELETE /sites/{siteName}/dataPreviewPermission

This API is disable data preview for a site.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

async

 

query

string

Example to disable data preview for a site

curl -X DELETE -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/dataPreviewPermission"

Example to disable data preview for a site as ldap user with BD_ADMIN rights

curl -X DELETE -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites/test_site/dataPreviewPermission"

Example to Disable data preview for a site (X-HTTP-Method-Override)

curl -X POST -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/dataPreviewPermission" -H "X-HTTP-Method-Override:DELETE"

POST /sites/{siteName}/refresh

This API is refresh a site by contacting the site.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

async

 

query

string

Example to refresh site 'test_site'

curl -X POST -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/refresh"

Example to Refresh site 'test_site' (as ldap user with BD_ADMIN rights)

curl -X POST -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites/test_site/refresh"

GET /sites/{siteName}/scheduledRefresh

This API is get the refresh schedule settings of a site from Business Directory.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

Example to get refresh schedule info for site 'test_site'

curl -X GET -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/scheduledRefresh"

Example to get refresh schedule info for site 'test_site' (as ldap user with BD_ADMIN rights)

curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites/test_site/scheduledRefresh"

PUT /sites/{siteName}/scheduledRefresh

This API is set the refresh schedule settings of a site from Business Directory.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

Request Body

{
  "enabled": true,
  "clusterAware": true,
  "startTime": "string",
  "endTime": "string",
  "interval": "string"
}

Example to set refresh schedule info for site 'test_site'.

curl -X PUT -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/scheduledRefresh" -H "Content-Type:application/json" -d "{\"enabled\" : \"true\", \"clusterAware\" : \"false\", \"startTime\" : \"2014-06-20 12:00:00\", \"endTime\" : \"2014-06-21 12:00:00\", \"interval\" : \"1d\" }"

Example to set refresh schedule info for site 'test_site' as ldap user with BD_ADMIN rights

curl -X PUT -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites/test_site/scheduledRefresh" -H "Content-Type:application/json" -d "{\"enabled\" : \"true\", \"clusterAware\" : \"false\", \"startTime\" : \"2014-06-20 12:00:00\", \"endTime\" : \"2014-06-21 12:00:00\", \"interval\" : \"1d\" }"

Example to Set refresh schedule info for site 'test_site' (X-HTTP-Method-Override):

curl -X POST -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/scheduledRefresh" -H "X-HTTP-Method-Override:PUT" -H "Content-Type:application/json" -d "{\"enabled\" : \"true\", \"clusterAware\" : \"false\", \"startTime\" : \"2014-06-20 12:00:00\", \"endTime\" : \"2014-06-21 12:00:00\", \"interval\" : \"1d\" }"

DELETE /sites/{siteName}/scheduledRefresh

This API is used to delete a site schedule refresh from Business Directory.

Parameters

Name

Description

Parameter Type

Data Type

siteName

 

path

string

Example to delete a site refresh schedule for 'test_site'

curl -X DELETE -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/scheduledRefresh"

Example to delete a site refresh schedule for 'test_site' as ldap user with BD_ADMIN rights

curl -X DELETE -u user@ldapDomain:password "https://localhost:9502/rest/v2/sites/test_site/scheduledRefresh"

Example to Delete a site refresh schedule for 'test_site' (X-HTTP-Method-Override)

curl -X POST -u admin:admin "https://localhost:9502/rest/v2/sites/test_site/scheduledRefresh" -H "X-HTTP-Method-Override:DELETE"