This section explains the following REST operations regarding the associations of the resource which has been secured with OAuth 2.0.
- Get all the associations on a resource.
- Get an association of specific type on a given resource.
- Add the associations to a resource.
- Delete an association on a given resource
The following terms explains the meaning of the parameters passed with the below REST URIs.
Parameter | Explanation |
---|---|
resource path | Path of the resource |
OAuth access token | Authorized access token per user for an hour by default |
association type | Type of association. By Default, Governance Registry has three types of association. Those are usedBy, ownedBy, and other. |
array of values | Array of values for the property eg: ["val1","val2","val3",......] |
arget resource path | start page number |
number of records | number of associations to be fetched |
The {start page} and {number of records} parameters can take any value greater than or equal to 0. The {start page} and {number of records} begins with 1. If both of them are 0, then all the associations will be retrieved.
Get all the associations on a resource
Attributes | Values |
---|---|
HTTP Method | GET |
Request URI | /associations?path={ resource path }&start={ start page }&size={ number of records } |
HTTP Request Header | Authorization: Bearer { OAuth access token } |
Response | It retrieves all the associations posted on the specific resource. |
Response Type | JSON |
Get associations of specific type on a given resource
Attributes | Values |
---|---|
HTTP Method | GET |
Request URI | /associations?path={ resource path }&type={ association type } |
HTTP Request Header | Authorization: Bearer {OAuth access token} |
Response | It retrieves all the associations for the specific type on the given resource |
Response Type | JSON |
Add associations to a resource
Attributes | Values |
---|---|
HTTP Method | POST |
Request URI | /association?path={resource path} |
HTTP Request Header | Authorization: Bearer {OAuth access token} Content-Type: application/json |
Payload | [ {"target":"<target resource path>","type":"<association type>" } ] |
Description | It add the array of associations passed as the payload for the source resource |
Response Type | JSON |
Delete an association on a given resource
Attributes | Values |
---|---|
HTTP Method | DELETE |
Request URI | /association?path={resource path}&type={association type}&target={target resource path} |
HTTP Request Header | Authorization: Bearer {OAuth access token} |
Description | It deletes the association between the source and target resources for the given association type. |
Response Type | JSON |