All Products
Search
Document Center

Public Model Calling Method

Last Updated: Jun 01, 2020

Prerequisites

Before you deploy an online model service, you must activate API Gateway. Alibaba Cloud API Gateway provides a hosting service for managing the lifecycle of APIs. For more information about pricing, see API Gateway pricing.

Call methods

After API Gateway is activated and Elastic Algorithm Service (EAS) deploys the service, the system automatically generates an endpoint for the service. You can send HTTP requests to this endpoint to call the service. To obtain the endpoint and the required authentication information, go to the Elastic Algorithm Service (EAS) page and then click the service name.
image.png

Advanced features based on API Gateway

1. View API information

  1. On the Alibaba Cloud site, select Console > Products<> > <>Application Services > <>API Gateway<> to log on to the API Gateway console.
    ! [] ( https://cdn.nlark.com/yuque/0/2019/png/227971/1551716877688-f0aac6a2-8f55-4be4-9b3b-b7a5ce566449.png#align=left&display=inline&height=460&originHeight=762&originWidth=1193&size=0&status=done&width=720)
  2. Select the China (Shanghai) region to view the API information generated during the service deployment process.
    ! [] ( https://cdn.nlark.com/yuque/0/2019/png/227971/1551716877697-5f7313e3-d154-4ba3-9d0e-ab096e4e61e5.png#align=left&display=inline&height=290&originHeight=325&originWidth=806&size=0&status=done&width=720)
  3. Click Manage in the <>Actions<> column to view the API configuration.
    ! [] ( https://cdn.nlark.com/yuque/0/2019/png/227971/1551716877725-f2a0457a-6176-477f-afbd-335c58841312.png#align=left&display=inline&height=27&originHeight=68&originWidth=1813&size=0&status=done&width=720)

2. Authorize APPs for the API

Click Authorize in the Actions column to authorize users. These users are known as APPs in API Gateway. Only authorized APPs can call the API. This guarantees the security of the API.
! [] ( https://cdn.nlark.com/yuque/0/2019/png/227971/1551716877717-39b5bcc7-14b0-44ae-b97d-180d28548601.png#align=left&display=inline&height=565&originHeight=641&originWidth=847&size=0&status=done&width=746)

3. Bind the API group to a domain name

Every API belongs to an API group. You can create API groups to manage APIs.

  1. Log on to the API Gateway console, and select APIs.
  2. Select the target region. In this example, the China (Shanghai) region is selected. Click the API name to view the API group information.
    ! [] ( https://cdn.nlark.com/yuque/0/2019/png/227971/1551716877736-34699568-40e7-453f-a9cd-1369a33b6d44.png#align=left&display=inline&height=202&originHeight=520&originWidth=1851&size=0&status=done&width=720)

  3. Click the Back<> icon in the upper-left corner and then select API Groups<>. Click the name of the API group that contains your API to view the subdomain name.
    ! [] ( https://cdn.nlark.com/yuque/0/2019/png/227971/1551716877734-bf482212-f9f6-47f4-a27f-5a0727b2dd8f.png#align=left&display=inline&height=207&originHeight=531&originWidth=1849&size=0&status=done&width=720)
    By default, a subdomain name is bound to the API group. The subdomain name is only for testing purposes. It can be accessed for up to 1,000 times per day.

  4. If you have more requirements, Select API Groups > <>Bind Domain<> to bind a domain name to the API group.
    ! [] ( https://cdn.nlark.com/yuque/0/2019/png/227971/1551716877758-e1c2ed90-f94b-4bc4-98b1-35eec4f3747a.png#align=left&display=inline&height=134&originHeight=344&originWidth=1851&size=0&status=done&width=720)

    For more information, see Bind domain name and certificate.