Unknown macro: {next_previous_links}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

This section explains the following REST operations regarding the associations of resource which have 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

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 soon.

Get all the associations on a resource

AttributesValues

HTTP Method                

GET
Request URIhttp://<ip address>:<port>/restapi/associations?path=<resource path>&pagestart=0&pageend=0
HTTP Request HeaderAuthorization: Bearer <OAuth access token>
Responseit retrieves all the associations posted on the specific resource.
Response TypeJSON

Get associations of specific type on a given resource

AttributesValues

HTTP Method                 

GET
Request URIhttp://<ip address>:<port>/restapi/associations?path=<resource path>&type=<association type>
HTTP Request HeaderAuthorization: Bearer <OAuth access token>

Response

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

Add  associations to a resource

AttributesValues

HTTP Method                 

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

Authorization: Bearer <OAuth access token>

Content-Type: application/json

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

Response

it retrieves all the associations including added ones
Response TypeJSON

Delete an association on a given resource

AttributesValues

HTTP Method                 

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

Response

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

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, Greg has 3 types, such as usedBy, ownedBy, other.
  • restapi                         - name of the War file for the REST API resides at {Greg_home}/repository/deployment/server/jaxwebapps/.
                                           If the user renamed this war file, the new name will be used instead of restapi.
  • target - path of the target resource with which the association is established

 

 

 

 

 

 

 

 

 

 

 

 

 

  • No labels