-->

Is there any API available to perform publisher op

2019-06-24 05:18发布

问题:

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

回答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



回答2:

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)

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