使用Anypoint Exchange / Platform API在Anypoint Exchange中创建一个HTTP-API类型的资产。

huangapple go评论53阅读模式
英文:

Create an Asset of HTTP-API Type in Anypoint Exchange using Exchange / Platform API?

问题

我如何在Anypoint Exchange中使用Platform/Exchange API创建一个http-api类型的资产?

我正在尝试自动化我的构建管道中的HTTP API代理生成,因为HTTP API没有RAML,所以我对如何创建交换资产感到有些困惑。

我知道有一个API可以接受JSON输入来创建交换资产,但由于资产没有RAML,我无法准确追踪它的位置。

英文:

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.

答案1

得分: 1

文档中的逐步指南以及链接到该页面的示例,指向资产创建API文档门户,包含了你所需的所有信息。每种类型的资产都有示例,包括HTTP API。

HTTP API

该示例创建了一个HTTP类型的资产。

每个新版本的HTTP API都应增加主要版本号。例如,从1.0.0增加到2.0.0。

更改以下字段:

organizationId
groupId
assetId
version
name
description
assetLink
apiVersion

注意:需要指定类型字段,因为它无法从文件分类器中推断出来。

curl -v \
  -H 'Authorization: bearer ANYPOINT_TOKEN' \
  -H 'x-sync-publication: true' \
  -F 'name=http asset name' \
  -F 'description=资产描述' \
  -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
英文:

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

huangapple
  • 本文由 发表于 2023年4月7日 05:35:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75953960.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定