All Products
Search
Document Center

API Gateway:Create an HTTP API

Last Updated:May 21, 2025

HTTP APIs are interfaces based on the HTTP protocol that quickly expose internal services of distributed systems. This topic describes how to create an HTTP API in the console.

Scenarios

Cloud-native API Gateway provides two methods to create APIs: within an instance and outside an instance. These methods apply to the following scenarios:

Create APIs within an instance

  • Dedicated resource management: The API is required only within a specific instance to manage specific resources or internal logic.

  • Security and isolation: Data or features need to be strictly isolated to ensure security and can be called only within the instance.

  • Simplified service configuration: Simplifies API configuration and management within a specific instance.

Create APIs outside an instance

  • Cross-instance sharing and access: Multiple instances share API definition information.

  • Centralized management and monitoring: Unified access control, logging, and traffic management.

Important
  • APIs created within an instance are visible and can be managed only in the corresponding instance.

  • APIs created outside an instance cannot be edited or deleted within an instance. You need to go to the API list outside the instance to perform these operations.

Create an HTTP API in the console

  1. Cloud-native API Gateway provides two methods to create APIs: within an instance and outside an instance:

    APIs outside an instance

    1. Log on to the Cloud-native API Gateway console. In the left-side navigation pane, select API, and select a region in the top menu bar.

    2. Click Create API, and then click Create in the HTTP API card.

    APIs within an instance

    1. Log on to the Cloud-native API Gateway console. In the left-side navigation pane, select Instances, and select a region in the top menu bar.

    2. On the Instances page, click the ID of the target gateway instance. In the left-side navigation pane, select API, and click Create API in the upper-right corner.

    3. Click Create in the HTTP API card.

  2. In the Create HTTP API panel, configure the related parameters and click OK.

    Configuration item

    Description

    API Name

    Specify a custom name for the API that you want to create. The API name must be globally unique.

    Description

    Enter a description for the API.

    Resource Group

    Select the target resource group. You can click Create Resource Group on the right.

Create an HTTP API by importing an Ingress

Prerequisites

You need to first create a Container Service service source in Cloud-native API Gateway. For more information, see Service source management.

Procedure

  1. Cloud-native API Gateway provides two methods to create APIs: within an instance and outside an instance:

    APIs outside an instance

    1. Log on to the Cloud-native API Gateway console. In the left-side navigation pane, select API, and select a region in the top menu bar.

    2. Click Create API, and then click Import Ingress in the HTTP API card.

    APIs within an instance

    1. Log on to the Cloud-native API Gateway console. In the left-side navigation pane, select Instances, and select a region in the top menu bar.

    2. On the Instances page, click the ID of the target gateway instance. In the left-side navigation pane, select API, and click Create API in the upper-right corner.

    3. Click Import Ingress in the HTTP API card.

  2. Click Import Ingress in HTTP API. On the Import Ingress page, configure the Ingress-related parameters and click OK.

    Configuration item

    Description

    API Name

    The API name. You can also click Add Description to provide information about the routing.

    Description

    Enter a description for the API. The description can be up to 255 characters in length.

    Instance

    Select the corresponding Cloud-native API Gateway instance.

    Source Cluster

    Select the cluster to which the Ingress belongs.

    Resource Group

    Select the corresponding resource group.

    Namespace

    Specify a namespace to listen for. If you leave this parameter empty, all Ingress resources in all namespaces are listened for.

    IngressClass

    Specify the IngressClass to listen for. If you leave this parameter empty, all types of Ingress resources are listened for.

    Update Ingress Status

    After you enable this feature, the status endpoint of the listened Ingress is replaced with the ingress endpoint of the gateway instance.