Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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.
Note

Since the current Registry REST API did not implement the pagination right now, If the user specifies any value other than 0 for the pagestart or pageend in the REST requests will throw HTTP 404 error code. Even though the  user omits the pagestart and pageend parameters to be passed with URL , the request will work with the current REST API. Pagination support to REST API will be adapted soonThe following terms explains the meaning of the parameters passed with the below REST URIs.

  • resource path - Path of the source 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.
  • target resource path - The path of the target resource with which the association is established.
  • start page - start page number
  • number of  records - number of associations to be fetched.
Get all the associations on a resource

...

AttributesValues

HTTP Method                 

GET
Request URI/associations?path={ resource path }&type={ association type }
HTTP Request HeaderAuthorization: Bearer <OAuth {OAuth access token>token}

Response

It retrieves all the associations for the specific type on the given resource
Response TypeJSON

...

AttributesValues

HTTP Method                 

POST
Request URIhttp://<ip address>:<port>/restapi/association?path=<resource path>{resource path}&type=<association type>{association type}
HTTP Request Header

Authorization: Bearer <OAuth {OAuth access token>token}

Content-Type: application/json

Payload[ {"target":"<target resource path>","type":"<association type>" } ]

Response

It retrieves all the associations including the added ones
Response TypeJSON

...

AttributesValues

HTTP Method                 

DELETE
Request URIhttp://<ip address>:<port>/restapi/association?path=<resource path>{resource path}&type=<association type>{association type}&target=<target {target resource path>path}
HTTP Request HeaderAuthorization: Bearer <OAuth {OAuth access token>token}

Response

It retrieves the rest of the associations for the given resource after deletion.
Response TypeJSON
Note

Please note the following points for the above requests.

ip address - IP address at which Governance Registry is running

.

  • port - HTTP port number at the Governance Registry is up.
  • 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. These are usedBy, ownedBy, and other.
  • restapi - Name of the .war file for the REST API resides at {Greg_home}/repository/deployment/server/jaxwebapps/. If you renamed this .war file, the new name is used instead of restapi.
  • target target resource path - The path of the target resource with which the association is established.
  • start page - start page number
  • number of  records - number of records to be fetched.