Resources
The different operations that can be performed on the Business Directory resources are:
| • | GET /resources |
| • | GET /resources/{resourceType}/guid/{resourceGuid} |
| • | GET /resources/{resourceType}/guid/{resourceGuid}/columns |
| • | GET /resources/{resourceType}/guid/{resourceGuid}/columns/id/{columnId} |
| • | GET /resources/{resourceType}/guid/{resourceGuid}/columns/ {columnName} |
| • | GET /resources/{resourceType}/guid/{resourceGuid} |
| • | GET /resources/{resourceType}/guid/{resourceGuid}/columns |
| • | GET /resources/{resourceType}/guid/{resourceGuid}/columns/id/{columnId} |
| • | GET /resources/{resourceType}/guid/{resourceGuid}/columns/ {columnName} |
| • | GET /resources/{resourceType}/{resourcePath} |
| • | GET /resources/{resourceType}/{resourcePath}/categories |
| • | POST /resources/{resourceType}/{resourcePath}/categories |
| • | DELETE /resources/{resourceType}/{resourcePath}/categories |
| • | DELETE /resources/{resourceType}/{resourcePath}/categories/ {categoryName}/values/{valueName} |
| • | GET /resources/{resourceType}/{resourcePath}/columns |
| • | GET /resources/{resourceType}/{resourcePath}/columns/id/{columnId} |
| • | GET /resources/{resourceType}/{resourcePath}/columns/{columnName} |
GET /resources
This API is used to retrieve a resource by type and path, id, or guid. Execute a free-text search for resources. Returns a set of tuples in a 2-dimensional JSON array: [[row1col1value, row1col2value], [row2col1value, row2col2value]].If the 'includeFilterCounts' parameter is true and the 'q' parameter is included (even if empty), then the SearchCount procedure is used to fetch a list of valid filters for the search, and the result includes 'resources' and 'counts' objects.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
q |
Free-text search criteria |
query |
string |
|
resourceTypeFilter |
Filter by resource types |
query |
string |
|
siteNameFilter |
filter by site names |
query |
string |
|
datasourceIdFilter |
Filter by datasource ids |
query |
string |
|
categoryValueIdFilter |
Filter by category value ids |
query |
string |
|
watchFilter |
Filter by user's watches |
query |
boolean |
|
includeFilterCounts |
Include filter counts |
query |
boolean |
|
offset |
Offset of first result entry to return. Default = 0. |
query |
integer |
|
limit |
Maximum number of entries to return. Default = 2147483647. |
query |
integer |
|
type |
The type of the resource to retrieve |
query |
string |
|
path |
The path of the resource to retrieve. URL Encode any slashes in the path. |
query |
string |
|
id |
|
query |
integer |
|
guid |
|
query |
string |
Example to search for resources
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/?q=foo&limit=10&offset=0"
Example to search for resources as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/?q=foo&limit=10&offset=0"
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources?type=database_table&id=410266"
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources?type=database_table&path=%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo"
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources?type=database_table&path=%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo"
Example to get a count of resources searched for
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/?q=foo&count"
GET /resources/{resourceType}/guid/{resourceGuid}
This API is used to retrieve a resource by guid.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource to retrieve. |
path |
string |
|
resourceGuid |
The guid of the resource to retrieve. |
path |
integer |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/guid/09c50755-f0cb-46c3-83a0-b68d2d1c9cce"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/guid/09c50755-f0cb-46c3-83a0-b68d2d1c9cce"
GET /resources/{resourceType}/guid/{resourceGuid}/columns
This API is used to retrieve columns of a table by table type and guid.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource for which to retrieve columns |
path |
string |
|
resourceGuid |
The guid of the resource |
path |
string |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/guid/09c50755-f0cb-46c3-83a0-b68d2d1c9cce/columns"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/guid/09c50755-f0cb-46c3-83a0-b68d2d1c9cce/columns"
GET /resources/{resourceType}/guid/{resourceGuid}/columns/id/{columnId}
This API is used to retrieve a table column by table type and guid and column ID.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource for which to retrieve columns |
path |
string |
|
resourceGuid |
The guid of the resource |
path |
string |
|
columnId |
The column ID |
path |
integer |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/guid/09c50755-f0cb-46c3-83a0-b68d2d1c9cce/columns/id/11515"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/guid/09c50755-f0cb-46c3-83a0-b68d2d1c9cce/columns/id/11515"
GET /resources/{resourceType}/guid/{resourceGuid}/columns/ {columnName}
This API is used to retrieve a table column by table type and guid and column name.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource for which to retrieve columns |
path |
string |
|
resourceGuid |
The guid of the resource |
path |
string |
|
columnName |
The column name |
path |
string |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/guid/09c50755-f0cb-46c3-83a0-b68d2d1c9cce/columns/m_integer"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/guid/09c50755-f0cb-46c3-83a0-b68d2d1c9cce/columns/m_integer"
GET /resources/{resourceType}/id/{resourceId}
This API is used to retrieve a Retrieve a resource by ID.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource to retrieve |
path |
string |
|
resourceId |
The ID of the resource to retrieve. |
path |
integer |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/id/410266"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/id/410266"
GET /resources/{resourceType}/id/{resourceId}/columns
This API is used to retrieve columns of a table by table type and ID.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource to retrieve |
path |
string |
|
resourceId |
The ID of the resource to retrieve. |
path |
integer |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/id/410266/columns"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/id/410266/columns"
GET /resources/{resourceType}/id/{resourceId}/columns/id/{columnId}
Retrieve a table column by table type and ID and column ID.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource to retrieve |
path |
string |
|
resourceId |
The ID of the resource to retrieve. |
path |
integer |
|
columnId |
The column ID |
path |
integer |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/id/410266/columns/id/11515"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/id/410266/columns/id/11515"
GET /resources/{resourceType}/id/{resourceId}/columns/{columnName}
Retrieve a table column by table type and id and column name.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource to retrieve |
path |
string |
|
resourceId |
The ID of the resource to retrieve. |
path |
integer |
|
columnName |
The column name |
path |
string |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/id/410266/columns/m_integer"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/id/410266/columns/m_integer"
GET /resources/{resourceType}/{resourcePath}
This API is used to retrieve a resource by type and path.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource to retrieve |
path |
string |
|
resourcePath |
The path of the resource to retrieve. URL Encode any slashes in the path. |
path |
string |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo"
GET /resources/{resourceType}/{resourcePath}/categories
This API is used to fetch category classifications for a particular resource.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource for which to retrieve classifications |
path |
string |
|
resourcePath |
The path of the resource for which to retrieve classifications. URL Encode any slashes in the path. |
path |
string |
Example to list classifications for the resource "/localhost_9400/services/ databases/ ds/ foo"
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/categories"
Example to list classifications for the resource "/localhost_9400/services/ databases/ ds/ foo" as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/categories"
Equivalent system query
curl -X POST -u admin:admin "https://localhost:9502/rest/v2/data/typed" -H "Content-Type:application/json" -d "{\"query\":\"select * from ALL_CLASSIFICATIONS where RESOURCE_ID in (select RESOURCE_ID from ALL_BD_RESOURCES where RESOURCE_TYPE = 'database_table' and PARENT_PATH || '/' || RESOURCE_NAME = '/localhost_9400/services/databases/ds/foo' )\",\"standardSQL\":true}"
Example to count of all classifications for the resource "/localhost_9400/ services/ databases/ds/foo"
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/categories&count"
POST /resources/{resourceType}/{resourcePath}/categories
This API is used to classify a resource by associating them with category/value pairs.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource to classify |
path |
string |
|
resourcePath |
The path of the resource to classify. URL Encode any slashes in the path. |
path |
string |
Request Body
[
{"categoryName": "string",
"categoryValues": [
"string"
]
}
]
Example to classify a resource with the products/bestseller and products/favorite category/value pairs
curl -X POST -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/categories" -H "Content-Type:application/json" -d "[{\"categoryName\":\"products\", \"categoryValues\": [\"bestseller\", \"favorite\"]}]"
Example to classify a resource with the products/bestseller and products/favorite category/value pairs (as ldap user)
curl -X POST -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/categories" -H "Content-Type:application/json" -d "[{\"categoryName\":\"products\", \"categoryValues\": [\"bestseller\", \"favorite\"]}]"
DELETE /resources/{resourceType}/{resourcePath}/categories
This API is used to remove resource classifications.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource from which a classification is to be removed. |
path |
string |
|
resourcePath |
The path of the resource from which a classification is to be removed. URL Encode any slashes in the path |
path |
string |
Example to remove the products/bestseller and products/favorite category/value pair classification from a resource
curl -X DELETE -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/categories" -H "Content-Type:application/json" -d "[{\"categoryName\":\"products\", \"categoryValues\": [\"bestseller\", \"favorite\"]}]"
Example to remove the products/bestseller and products/favorite category/value pair classification from a resource (as ldap user)
curl -X DELETE -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/categories" -H "Content-Type:application/json" -d "[{\"categoryName\":\"products\", \"categoryValues\": [\"bestseller\", \"favorite\"]}]"
DELETE /resources/{resourceType}/{resourcePath}/categories/ {categoryName}/values/{valueName}
This API is used to remove a single resource classification.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource from which a classification is to be removed. |
path |
string |
|
resourcePath |
The path of the resource from which a classification is to be removed. URL Encode any slashes in the path. |
path |
string |
|
categoryName |
The name of the category associated with the classification to remove. |
path |
string |
|
valueName |
The name of the category value associated with the classification to remove. |
path |
string |
Example to remove a classification from a resource
curl -X DELETE -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/categories/products/values/bestseller"
Example to remove a classification from a resource as ldap user
curl -X DELETE -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/categories/products/values/bestseller"
GET /resources/{resourceType}/{resourcePath}/columns
This API is used to retrieve columns of a table by table type and path.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource for which to retrieve columns |
path |
string |
|
resourcePath |
The path of the resource. URL Encode any slashes in the path. |
path |
string |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/columns"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/columns"
GET /resources/{resourceType}/{resourcePath}/columns/id/{columnId}
This API is used to retrieve a table column by table type and path and column ID.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource for which to retrieve columns |
path |
string |
|
resourcePath |
The path of the resource. URL Encode any slashes in the path. |
path |
string |
|
columnId |
The column ID |
path |
integer |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/columns/id/11515"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/columns/id/11515"
GET /resources/{resourceType}/{resourcePath}/columns/{columnName}
This API is used to retrieve a table column by table type and path and column name.
Parameters
|
Name |
Description |
Parameter Type |
Data Type |
|
resourceType |
The type of the resource for which to retrieve columns |
path |
string |
|
resourcePath |
The path of the resource. URL Encode any slashes in the path. |
path |
string |
|
columnName |
The column name |
path |
string |
Example to retrieve a resource
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/columns/m_integer"
Example to retrieve a resource as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/resources/database_table/%2Flocalhost_9400%2Fservices%2Fdatabases%2Fds%2Ffoo/columns/m_integer"