Updated on 2026-06-25 GMT+08:00

Creating a Gateway

Function

This API is used to create a gateway.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    asm:mesh:createGateway

    Write

    mesh *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    -

    -

URI

POST /v2/meshes/{mesh_id}/gateways

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

mesh_id

Yes

String

Mesh ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format)

Range:

  • application/json;charset=utf-8: The content is in JSON format and encoded using UTF-8.

  • application/json: The content is in JSON format.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

cluster

Yes

String

Cluster ID

gateway

Yes

String

Gateway name

Enter 4 to 64 characters. The name must start with a lowercase letter and not end with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

namespace

Yes

String

Namespace

elbId

Yes

String

ID of the load balancer corresponding to a gateway

externalPort

Yes

ExternalPort object

External access port

serviceType

Yes

String

Gateway Service type. Currently, only LoadBalancer is supported.

tlsTerminationEnable

No

Boolean

Whether to enable TLS termination

certList

No

Array of CertServer objects

List of certificates used for enabling TLS termination

tlsMode

No

String

TLS mode. The value can only be SIMPLE.

externalIPs

Yes

Array of strings

IP address used by a load balancer. Multiple IP addresses can be configured.

maxProtocolVersion

Yes

String

Supported latest TLS version

minProtocolVersion

Yes

String

Supported earliest TLS version

ipv6Enable

No

String

Whether IPv6 is supported

Table 4 ExternalPort

Parameter

Mandatory

Type

Description

number

Yes

String

External port number

protocol

Yes

String

External protocol

hosts

Yes

Array of strings

External IP address. Multiple IP addresses can be configured.

Table 5 CertServer

Parameter

Mandatory

Type

Description

secretName

No

String

Name of the secret for storing the certificate content

hosts

No

Array of strings

Certificate hosts

maxProtocolVersion

No

String

Supported latest TLS version

minProtocolVersion

No

String

Supported earliest TLS version

Response Parameters

Status code: 200

The gateway is created.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

errorCode

String

Error code

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

errorCode

String

Error code

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

The gateway is created.

400

Failed to create the gateway due to incorrect parameters.

500

Internal error.

Error Codes

See Error Codes.