This procedure covers one way to create a RAML-based API in Anypoint Platform. You can create a modern RAML-based API from an existing SOAP-based API or start with just an idea and design the API from start to finish using RAML. In this procedure, you design the API from start to finish.
這個(gè)過程,是創(chuàng)建API的一種方式,通過Anypoint Platform創(chuàng)建基于RAML的API修壕。你可以根據(jù)一個(gè)既存的基于SOAP的API來創(chuàng)建一個(gè)新的基于RAML的API默赂,或者僅僅根據(jù)一個(gè)創(chuàng)意使用RAML從頭至尾設(shè)計(jì)一個(gè)API注暗。
Prerequisites
前提條件
To create an API in Anypoint Platform, you need an account and permissions. If you do not have an account, you can sign up for a free account in the cloud.
為了在Anypoint Platform上創(chuàng)建一個(gè)API章蚣,你需要一個(gè)賬號以及相應(yīng)權(quán)限攒砖。如果你還沒有賬號夯膀,可以免費(fèi)申請一個(gè)cloud賬號。
https://anypoint.mulesoft.com/login/#/signin
申請網(wǎng)址
If you set up your account in the cloud, you have the permissions to create an API. If you’re using an organization’s account, you might not have these permissioons. You need API Creators and/or Organization Administrator access. To determine your access level, after logging into Anypoint Platform, click Access Management.
如果你創(chuàng)建了cloud賬號回俐,你會(huì)自動(dòng)獲得創(chuàng)建API的許可逛腿。如果你創(chuàng)建的是機(jī)構(gòu)賬號稀并,可能沒有相應(yīng)的許可。需要API創(chuàng)建者和/或機(jī)構(gòu)管理員工權(quán)限单默。你可以在登入Anypoint Platform后碘举,點(diǎn)擊權(quán)限管理查看你的權(quán)限等級。
In the Access Management screen, click Roles, and look for API Creators or Organization Administrator. If one or both of these roles are visible in the Roles listing, you can proceed. If you cannot see these roles, contact your site administrator before proceeding with this procedure.
在權(quán)限管理界面搁廓,點(diǎn)擊Roles(角色)引颈,確認(rèn)是否是API創(chuàng)建者(API Creators)或者機(jī)構(gòu)管理員(Organization Administrator)。如果角色列表里兩者都有或者有其中之一境蜕,你就可以繼續(xù)后面的操作了蝙场。如果列表里沒有這兩個(gè)角色,聯(lián)系你的相應(yīng)的負(fù)責(zé)人為你設(shè)定相應(yīng)的角色粱年。
Create an API Definition and Build a RAML File
創(chuàng)建 一個(gè)API定義并且創(chuàng)建一個(gè)RAML文件
An API definition is the name of an API and its version that you specify in the API Manager.
API定義包含了在API Manger中區(qū)分API的API名稱以及版本號售滤。
1. After signing in to Anypoint Platform, set up the API.
登入Anypoint Platform后,設(shè)置API
2. Design the basic RAML API.
設(shè)計(jì)基本的RAML API台诗。
3. Simulate calls to the API.
模擬對API的調(diào)用