Reputation: 63
How can I create an asset of http-api type in Anypoint exchange using the Platform / Exchange API ?
I am trying to automate the HTTP API Proxy generation in my build pipeline and since an HTTP API doesn't have a RAML, I am little lost on how to create the asset to exchange?
I am aware that there in an API that can take a JSON input for the creating exchange assets but I am unable to trace it correctly where there is no RAML for the asset.
Upvotes: 0
Views: 342
Reputation: 25709
The step by step guide in the documentation plus the example linked on that page that points to the asset creation API documentation portal has all the information that you need. There are examples for each type of asset, including HTTP API.
HTTP API
This example creates an asset of type HTTP.
Increase the major version for each new version of an HTTP API. For example, increase from 1.0.0 to 2.0.0.
Change these fields:
organizationId groupId assetId version name description assetLink apiVersion
Note: The type field is specified because it can not be inferred from a file classifier.
curl -v \ -H 'Authorization: bearer ANYPOINT_TOKEN' \ -H 'x-sync-publication: true' \ -F 'name=http asset name' \ -F 'description=Description of the asset' \ -F 'type=http-api' \ -F 'properties.assetLink=http://www.my-http-api-url.com' \ -F 'properties.apiVersion=v3' \ https://anypoint.mulesoft.com/exchange/api/v2/organizations/:organizationId/assets/:groupId/:assetId/:version
Upvotes: 1