Versions Compared

Key

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

The Registry REST API allows you to work with registry resources such as comments, properties, and tags. The API uses the GET, POST, PUT, and DELETE operations of the well-defined HTTP protocol to do CRUD operation via any REST client. Google Chrome's Advanced REST client is one of the client tools used to test the functionality of the Registry REST API.

Panel

The Registry REST API is one of many APIs supported by the WSO2 Governance Registry. Read more on Supported APIs and Standards for a complete list of APIs supported by WSO2 Governance Registry.

Security

The Registry REST API is secured with a Basic Auth access token. You can invoke the rest API with the Basic Auth header

Authorization: Basic YWRtaW46YWRtaW4= where  where the format is Authorization: Basic {base64encoded(username:password)}
See the sections below for information relating to invoking the REST API after generating the access token and some sample requests:
 
Table of Contents
maxLevel3

Invoking the REST API

...

URI syntax

Each API is constructed as a URI. For example, to get all the comments, the syntax is: 

http://{ip:port}/{context}/{version}/comments?path={resource path}&start={start page}&size={no of records}

The prefix of each URI contains the following elements:

  • ip - IP address of the Governance Registry

  • port -  Port at which the Governance Registry is running.
  • context - Context of REST API invocation. By default it is "resource".
  • version - Since it is the initial version of the REST API, it is denoted as "1.0.0"

Here is a sample request that gets all the comments:

curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Cache-Control: no-cache" "https://localhost:9443/resource/1.0.0/comments?path=/_system/governance/trunk/soapservices/com/amazon/soap/1.0.0/AmazonSearchService" -i -k

API reference and samples

Under the REST API panel, all the REST invocations are summarized.

...

Click

...

the links below to get more information about the REST support specific to each aspect and to

...

see sample requests. Note that these sample requests are based on the samples in the Quick Start Guide, so you can deploy those samples to try the sample requests.
Panel

Comments ---- Information on how to add, retrieve, edit and delete comments of a resource

Properties --- Information on how to add, retrieve, edit and delete properties of a resource

Tags --- Information on how to add, retrieve and delete tags of a resource and retrieve resources tagged together

Associations --- Information on how to add, retrieve, edit and delete associations of a resource

Rating --- Information on how to add, retrieve, edit and delete rating of a resource.

Resources --- Information on how to add, retrieve and delete a resource

Collection --- Information on how to add, retrieve and delete a collection.

Metadata --- Metadata information about the resources and collections

Sample requests

Following are some sample  REST calls format to the Registry REST API. 

Note
titleIMPORTANT
  • context - Context of REST API invocation. It is the by default "resource".
  • version - Since it is the initial version of the REST API, it is denoted as "1.0.0"
  • ip - IP address of the Governance Registry
  • port -  Port at which the Governance Registry is running.

Get All the Comments:

...

     Example :  http://localhost:9763/resource/1.0.0/comments?path=/_system/governance/sample.xml&start=1&size=3

Post a Comment:

      Format   :  http://{ip:port}/{context}/{version}/comment?path={resource path}

      Header   : Content-Type = text/plain

      Example :  http://localhost:9763/resource/1.0.0/comment?path=/_system/governance/sample.xml

      Header   :  Content-Type = text/plain