To Design an API ----設計一個API

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.

這個過程,是創建API的一種方式,通過Anypoint Platform創建基於RAML的API。你可以根據一個既存的基於SOAP的API來創建一個新的基於RAML的API,或者僅僅根據一個創意使用RAML從頭至尾設計一個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上創建一個API,你需要一個賬號以及相應權限。如果你還沒有賬號,可以免費申請一個cloud賬號。

https://anypoint.mulesoft.com/login/#/signin

申請網址

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.

如果你創建了cloud賬號,你會自動獲得創建API的許可。如果你創建的是機構賬號,可能沒有相應的許可。需要API創建者和/或機構管理員工權限。你可以在登入Anypoint Platform後,點擊權限管理查看你的權限等級。

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.

在權限管理界面,點擊Roles(角色),確認是否是API創建者(API Creators)或者機構管理員(Organization Administrator)。如果角色列表裏兩者都有或者有其中之一,你就可以繼續後面的操作了。如果列表裏沒有這兩個角色,聯繫你的相應的負責人爲你設定相應的角色。

Create an API Definition and Build a RAML File

創建 一個API定義並且創建一個RAML文件

An API definition is the name of an API and its version that you specify in the API Manager.

API定義包含了在API Manger中區分API的API名稱以及版本號。

1. After signing in to Anypoint Platform, set up the API.

登入Anypoint Platform後,設置API

2. Design the basic RAML API.

設計基本的RAML API。

3. Simulate calls to the API.

模擬對API的調用

轉自:https://www.jianshu.com/p/da552654cf7f

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章