DataWorks Data Service

更新时间:
复制 MD 格式

This topic explains how to connect Hologres, a real-time data warehouse, to DataWorks Data Service and generate an API.

Prerequisites

  • DataWorks is activated. For more information, see Overview.

  • A Hologres instance is purchased and associated with a DataWorks workspace.

Background information

DataWorks DataService Studio is designed to build a unified data service bus to help you manage APIs. You can create APIs from tables or register existing APIs with DataService Studio. This helps you manage and publish APIs in a centralized manner.

Hologres is deeply integrated with DataWorks and directly connects to DataService Studio. You can quickly create APIs based on data query results and use the APIs to provide services.

Procedure

  1. Log on to the DataWorks console and add a Hologres data source. For more information, see Associate a Hologres computing resource.

  2. Create an API.

    1. On the DataWorks development page, click the icon icon on the left side of the top menu bar.

    2. Hover over All Products and click Data Service > Data Service.

    3. On the Service Development page, hover over the 新建 icon.

    4. Hover over Create API > Generate API. You can generate an API in either Codeless UI or Code Editor.

      To generate an API in Codeless UI, see Generate an API from a data source by using API Gateway.

      To generate an API in Code Editor, see Generate an API in script mode.

  3. Test the API.

    1. On the API editing page, click Test in the upper-right corner.

    2. In the API Test dialog box, enter the Request Parameter and click Start Dry Run. After the test is complete, the Response area displays a JSON response where errCode is 0 and errMsg is success. At the bottom, a green Test Succeeded message and the API call latency appear.

      If Success is displayed at the bottom of the API Test dialog box, the API test is successful.

      You can also test the API in the Test APIs module of DataService Studio. For more information, see Test an API.

  4. Publish and view the API.

    1. On the API editing page, click Publish in the upper-right corner.

      Publish the API to API Gateway and make the API available in the API marketplace. For more information, see API testing, publishing, and version management.

    2. On the DataService Studio page, click Service Management in the upper-right corner.

    3. Find the published API and click the API name to view the details.

  5. Call the API.

    For more information about how to call a published API, see Examples of calling an API.