WSO2 Governance Registry product provides a set of resources under its Publisher Rest API to perform CRUD operations over Associations of an asset instance.
Default it provides below API resources under /{context}/apis/association/
GET /{type}/{association}/{id}
Returns list of possible associatable target assets list.
{type} - source asset type
{association} - association name
{id} - source asset id
Parameters:
q="name":"*"
Returns associatable assets subject to default paging
q="name":"aa"
Returns associatable assets subject to search over name attribute for the provided input.
Ex: https://localhost:9443/publisher/apis/association/soapservices/reference/404cada0-5e8d-4e39-8c21-fdc96c1f0ccc?q="name"%3A"te"
Response:{"results":[{"uuid":"aaeab854-547d-4fcd-ac1f-f906e623877f","text":"tets","version":"1.2.3","type":"application/vnd.wso2-soap-service+xml","shortName":"soapservice"},{"uuid":"e47d7197-14a1-45a0-b43b-d46468ad58a0","text":"API_Test","version":"1.2.3","type":"application/vnd.wso2-restservice+xml","shortName":"restservice"},{"uuid":"e98b151b-6711-4963-84ef-6607a219817d","text":"testRest","version":"1.2.3","type":"application/vnd.wso2-restservice+xml","shortName":"restservice"}]}
GET /{type}
Returns association types defined in governance.xml for a given asset type.
Ex:https://localhost:9443/publisher/apis/association/soapservices
Response:[{"key":"ownedBy","value":"fw-user"},{"key":"security","value":"fw-security"},{"key":"depends","value":"fw-store"},{"key":"usedBy","value":"fw-globe"}]
POST /*
Add an association to a given asset instance
Ex: https://localhost:9443/publisher/apis/associationRequest Payload{"sourceUUID":"b26d640b-9239-42ec-aeda-d4fbb79d665a","destUUID":"e98b151b-6711-4963-84ef-6607a219817d","sourceType":"soapservice","destType":"restservice","associationType":"depends"}
DELETE /remove
Remove added association from an asset instance.
Ex: https://localhost:9443/publisher/apis/association/removeRequest Payload{"sourceUUID":"b26d640b-9239-42ec-aeda-d4fbb79d665a","destUUID":"e98b151b-6711-4963-84ef-6607a219817d","sourceType":"soapservice","destType":"restservice","associationType":"depends"}