4

I have read through the documents and I saw that there is a governance and a web service API available, but I do not understand the execution part. I would like to understand how to execute below operations through an API.

1) how can I publish service (SOAP or REST) using the API ?

2) how can I configure values to different items in publisher portal using API ?

Overview Categorization Contacts Interface Security Doc links Tags Taxonomy

3) how can I upload the artifacts WSDL, schema, policy etc ?.

Community
  • 1
  • 1
Alwaysalearner
  • 85
  • 1
  • 1
  • 10

2 Answers2

4

There are 3 ways to add resources remotely to G-Reg

i. Using registry REST API

Add a Resource using registry REST API

Retrieving Associations Using WSO2 G-Reg Registry API Explained

ii. Using publisher API (G-Reg 5.0.0 or above)

Create Schema:(Upload file)

Request

URL:https://<host>:<port>/publisher/assets/schema/apis/schemas?type=schema

Method: POST
Header:Cookie: JSESSIONID=<SESSION-ID>

Payload:(form data)
schema : schema
schema_file : <schema file name>.xsd
filename : <schema file name>.xsd
schema_file_name : <schema file name>.xsd
file_version : <version>
addNewSchemaFileAssetButton : Create

File Upload:

Upload the schema file. Give the field entry as ‘schema_file’

Response should be:

Status: 200 OK

To upload a zip file just change the schema_file,filename and schema_file_name values with zip file name.(I didn't test this but should work according to the source code.)

iii. Using Governance API - only for hosted content type resources. (G-Reg 5.2.0 or above)

Content type resource upload - WSDL sample request

What is the version your using? Hope these details will help you!

tk_
  • 16,415
  • 8
  • 80
  • 90
  • @thusarak These are really great information. Thanks for your help. I am using version 5.3. I have another question off the original topic. I am trying to look for vmware image but I am not able to find that anywhere. I see the available VM image is of version 4.x.x. Information are scattered everywhere. Please see if you can provide any info related to acquiring latest VM imagae. I would really appreciate your reply. Thanks, Prashant – Alwaysalearner Oct 21 '16 at 23:49
  • you mean VMware image of ubuntu+G-Reg? but you can create your own VM image within 10mins(9m generate the VM image.) Please clarify why you are doing this? Anyone can have an up and running WSO2 G-Reg within 2mins with samples. – tk_ Oct 23 '16 at 03:38
  • I have tried to upload wsdl using advanced google rest API. In response I get html content (publisher portal). – Alwaysalearner Oct 25 '16 at 22:37
  • you mean advance rest client? as far as I remember you should get an HTTP 201. Will you share the screenshot of your request and console ? – tk_ Oct 26 '16 at 02:24
  • I opened another question, it has a screenshot. If you can look at that. – Alwaysalearner Oct 26 '16 at 03:52
  • please provide the link to your question. – tk_ Oct 26 '16 at 05:09
1

WSO2 Governance Registry supports Registry REST API and Governance REST API. You can use these APIs to do all the above operations and also these documentations contain sample curl requests which you can get an idea of executing.

For the resources specific operations, refer to documentation [1] & [2]

[1] - https://docs.wso2.com/display/Governance530/Resources+with+REST+API

[2] - https://docs.wso2.com/display/Governance530/Governance+REST+API#GovernanceRESTAPI-Assets

madawa
  • 496
  • 6
  • 24