Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

This section explains the following REST operations regarding the associations / association of the resource which have been secured with OAuth 2.0.

Table of Contents

Note

The following terms explain the meaning of the query parameters passed with the following REST URIs.

...

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

...

ParameterExplanation
pathPath of the resource.
OAuth access tokenAuthorized access token per user for an hour by default.
typeType of association. By default, Governance Registry has three types of association. These are usedBy, ownedBy, and other.
startStart page number.
sizeNumber of associations to be fetched.
targetTarget resource path
Note

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 are retrieved.

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{ resource path }&start={ start page }&size={ number of records }
HTTP Request HeaderAuthorization: Bearer <OAuth { OAuth access token>token }
Responseit It retrieves all the associations posted on the specific resource.
ResponseHTTP 200 OK
Response TypeJSONapplication/json

Get

...

Associations of

...

Specific Type on a

...

Given Resource

AttributesValues

HTTP Method                 

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

ResponseDescription

it It retrieves all the associations for the specific type on of the given resource
ResponseHTTP 200 OK
Response TypeJSON

...

application/json

Add Associations to a

...

Resource

AttributesValues

HTTP Method                 

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

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

Content-Type: application/json

Payload[{ "targettype":"<target path><type of the association>","typetarget":"<association type><valid resource path>"}] 

Response

it retrieves all the associations including added ones

Description

It adds the array of associations passed as the payload for the source resource
ResponseHTTP 204 No Content.
Response TypeJSON

...

application/json

Add Association to a Resource

...

AttributesValues

HTTP Method                 

DELETEPOST
Request URIhttp://<ip address>:<port>/restapi/association/associations?path=<resource path>&type=<association type>&target=<target resource path>{resource path}&targetPath={target resource}&type={assocation type}
HTTP Request Header

Authorization: Bearer

<OAuth access token>

Response

it retrieves rest of the associations for the given resource after deletion

{OAuth access token}

Content-Type: application/json

ResponseHTTP 204 No Content.
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, 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

 

 

 

 

 

 

 

 

 

 

application/json

Delete Associations on a Given Resource

AttributesValues

HTTP Method                 

DELETE
Request URI/association?path={resource path}&targetPath={target path}&type={association type}

Description

It deletes the association between the source and target resources for the given association type.
ResponseHTTP 204 No Content.
Response Typeapplication/json