This documentation is for WSO2 Governance Registry 5.3.0. View documentation for the latest release.

Versions Compared

Key

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

This section explains the

...

REST operations

...

for working with resources that have been secured with Basic Auth.

Table of Contents

...

maxLevel3

Query parameters

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

ParameterExplanation
Resource pathPath of the resource
MIME typeMIME type of the resource to be added. E.g., application/wsdl+xml media type for WSDL files.

...

For details on security (the authorization header) and the URI syntax (port, context, etc.), see Registry REST API.

 

Get the content of a resource

AttributesValues
HTTP MethodGET
Request URI/artifact{ resource path }
HTTP Request HeaderAuthorization: Basic { base64encoded(username:password) }
Description                       Content of the requested resource
ResponseHTTP 200 OK
Response Typeapplication/octet-stream

...

Sample request

curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 456519f1-617d-8c52-ca22-7af5a4ae6c1c" "https://localhost:9443/resource/1.0.0/artifact/_system/governance/trunk/soapservices/com/amazon/soap/1.0.0/AmazonSearchService"


Add a resource

AttributesValues
HTTP MethodPUT
Request URI/artifact{ complete path of the resource to be added }
HTTP Request Header

Authorization: Basic { base64encoded(username:password) }

Media-Type: {Media type of the resource}

Request Content Type{ Mime MIME type of the resource }
PayloadContent of the resource
ResponseHTTP 204 No content.
DescriptionAdd the content of the resource sent via payload to the requested path at the URI.

...

Sample request
Code Block
curl -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Media-Type: application/xml" -H "Content-Type: application/xml" -H "Cache-Control: no-cache" -H "Postman-Token: fa3c1088-48d9-1330-c398-bac27182ddc9" -d '<metadata xmlns="http://www.wso2.org/governance/metadata">
	<overview>
    	<namespace>http://soap.amazon.com</namespace>
    	<name>AmazonSearchService</name>
    	<description>Adding the WSDL file  Amazon Web Services.wsdl</description>
    	<version>1.0.0</version>
	</overview>
	<endpoints>
    	<entry>:http://soap.amazon.com/onca/soap2</entry>
	</endpoints>
	<categorization>
    	<tier>Bronze</tier>
    	<language>Java</language>
	</categorization>
	<interface>
    	<wsdlURL>/_system/governance/trunk/wsdls/com/amazon/soap/1.0.0/Amazon Web Services.wsdl</wsdlURL>
	</interface>
</metadata>' "https://localhost:9443/resource/1.0.0/artifact/_system/governance/trunk/sample.xml" -i -k

 

Update a resource

AttributesValues
HTTP MethodPUT
Request URI/artifact{ complete path of the resource to be added }
HTTP Request Header

Authorization: Basic { base64encoded(username:password) }

Media-Type: {Media type of the resource}

PayloadContent of the resource which is going to be updated
DescriptionUpdate the resource
ResponseHTTP 204 No Content
Sample request
Code Block
languagexml
curl -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Media-Type: application/xml" -H "Content-Type: application/xml" -H "Cache-Control: no-cache" -d '<metadata xmlns="http://www.wso2.org/governance/metadata">
	<overview>
    	<namespace>http://soap.amazon.com</namespace>
    	<name>AmazonSearchService</name>
    	<description>Adding the WSDL Updated </description>
    	<version>1.0.0</version>
	</overview>
	<endpoints>
    	<entry>:http://soap.amazon.com/onca/soap2</entry>
	</endpoints>
	<categorization>
    	<tier>Bronze</tier>
    	<language>Java</language>
	</categorization>
	<interface>
    	<wsdlURL>/_system/governance/trunk/wsdls/com/amazon/soap/1.0.0/Amazon Web Services.wsdl</wsdlURL>
	</interface>
</metadata>' "https://localhost:9443/resource/1.0.0/artifact/_system/governance/trunk/sample.xml" -i -k

 

Delete a

...

resource

AttributesValues
HTTP MethodDELETE
Request URI/artifact/{ resource path }?user={ user name }
HTTP Request HeaderAuthorization: Basic { base64encoded(username:password) }
ResponseHTTP 204 No Content
DescriptionIt deletes the requested resource if it exists.
Sample request

curl -X DELETE -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Cache-Control: no-cache"  "https://localhost:9443/resource/1.0.0/artifact/_system/governance/trunk/sample.xml" -i -k