Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Dedicated Gateway (Pay-Per-Use)

Function

This API is used to create a pay-per-use dedicated gateway.

Calling Method

For details, see Calling APIs.

URI

POST /v2/{project_id}/apigw/instances

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain it, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

description

No

String

Gateway description. The value can contain up to 255 characters except > and <.

maintain_begin

No

String

Start time of the maintenance time window. It must be in the format "xx:00:00". The value of xx can be 02, 06, 10, 14, 18, or 22.

During the maintenance time period, O&M personnel perform maintenance on the gateway. During this period, services can still be used, but occasionally there may be temporary interruptions. Scheduled maintenance occurs infrequently (typically once every several months).

maintain_end

No

String

End time of the maintenance time window. It must be in the format "xx:00:00". There is a 4-hour difference between the start time and end time.

During the maintenance time period, O&M personnel perform maintenance on the gateway. During this period, services can still be used, but occasionally there may be temporary interruptions. Scheduled maintenance occurs infrequently (typically once every several months).

instance_name

Yes

String

Gateway name.

Enter 3 to 64 characters, starting with a letter. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Minimum: 3

Maximum: 64

instance_id

No

String

Gateway ID, which will be automatically generated if you do not specify this parameter.

spec_id

Yes

String

Gateway edition. Options:

  • BASIC
  • PROFESSIONAL
  • ENTERPRISE
  • PLATINUM
  • BASIC_IPV6
  • PROFESSIONAL_IPV6
  • ENTERPRISE_IPV6
  • PLATINUM_IPV6

Enumeration values:

  • BASIC
  • PROFESSIONAL
  • ENTERPRISE
  • PLATINUM
  • BASIC_IPV6
  • PROFESSIONAL_IPV6
  • ENTERPRISE_IPV6
  • PLATINUM_IPV6

vpc_id

Yes

String

VPC ID.

You can obtain it in either of the following ways:

  • Method 1: Log in to the VPC console, and click the name of a VPC to view the VPC ID on the displayed details page.
  • Method 2: Call the corresponding VPC API. For details, see section "Querying VPCs" in the VPC API Reference.

subnet_id

Yes

String

Subnet network ID.

You can obtain it in either of the following ways:

  • Method 1: Log in to the VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page.
  • Method 2: Call the corresponding VPC API. For details, see section "Querying Subnets" in the VPC API Reference.

security_group_id

Yes

String

ID of the security group to which the gateway belongs.

You can obtain it in either of the following ways:

  • Method 1: Log in to the VPC console. Choose Access Control > Security Groups in the navigation pane. On the Security Groups page, click the target security group. Then view the security group ID on the displayed page.
  • Method 2: Call the corresponding VPC API. For details, see section "Querying Security Groups" in the VPC API Reference.

eip_id

No

String

EIP ID.

This parameter is required if public access is enabled for the gateway and loadbalancer_provider is set to lvs. After you bind an EIP to the gateway, users can access APIs in the gateway from public networks using the EIP.

To obtain an EIP ID, log in to the VPC console, and choose "Elastic IP and Bandwidth" > "EIPs" in the navigation pane. Click the name of the target EIP, and view the EIP ID on the displayed page.

enterprise_project_id

No

String

Enterprise project ID. This parameter is required for an enterprise account.

You can obtain it in either of the following ways:

  • Method 1: Log in to the Enterprise Project Management page, click the name of the target enterprise project, and view the project ID on the displayed page.
  • Method 2: Call the corresponding project management API. For details, see section "Querying the Enterprise Project List" in the Enterprise Management API Reference.

available_zone_ids

Yes

Array of strings

AZs.

An AZ is a physical region where resources use independent power supply and networks. AZs are physically isolated but interconnected through an internal network. To enhance application availability, create gateways in different AZs.

To obtain AZ information, call the API used to query AZs.

bandwidth_size

No

Integer

Outbound access bandwidth.

This parameter is required if public outbound access is enabled for the gateway. After you configure the bandwidth for the gateway, users can access resources on public networks.

Default: 5

bandwidth_charging_mode

No

String

Billing type of the public outbound access bandwidth. This parameter is required if public outbound access is enabled for the gateway.

  • bandwidth: billed by bandwidth
  • traffic: billed by traffic

Default: bandwidth

Enumeration values:

  • bandwidth
  • traffic

ipv6_enable

No

Boolean

Indicates whether public access with an IPv6 address is supported.

Currently, IPv6 addresses are supported only in certain regions.

loadbalancer_provider

No

String

Type of the load balancer used by the gateway.

  • LVS
  • ELB (available only in certain regions)

Default: lvs

Enumeration values:

  • lvs
  • elb

tags

No

Array of TmsKeyValue objects

Tags.

A maximum of 20 tags can be created for a gateway.

Array Length: 0 - 20

vpcep_service_name

No

String

Name of a VPC endpoint service.

It can contain max. 16 characters, including letters, digits, hyphens (-), and underscores.

If this parameter is not specified, the system automatically generates a name in the "{region}.apig.{service_id}" format.

If this parameter is specified, the system automatically generates a name in the "{region}.{vpcep_service_name}.{service_id}" format.

After the gateway is created, you can modify this name on the Gateways > VPC Endpoints page.

ingress_bandwidth_size

No

Integer

Public inbound access bandwidth.

This parameter is required if public inbound access is enabled for the gateway and loadbalancer_provider is set to elb. After you bind an EIP to the gateway, users can access APIs in the gateway from public networks using the EIP.

Default: 5

ingress_bandwidth_charging_mode

No

String

Billing type of the public inbound access bandwidth. This parameter is required if public inbound access is enabled for the gateway and loadbalancer_provider is set to elb.

  • bandwidth: billed by bandwidth
  • traffic: billed by traffic

Default: bandwidth

Enumeration values:

  • bandwidth
  • traffic
Table 4 TmsKeyValue

Parameter

Mandatory

Type

Description

key

No

String

Key.

Include UTF-8 letters, digits, spaces, or special characters (_.:=+-@).

Do not start with _sys_ because it is a system label.

Minimum: 1

Maximum: 128

value

No

String

Value.

You can enter letters, digits, and spaces or other special characters (_.:/=+-@) in UTF-8 format.

Minimum: 0

Maximum: 255

Response Parameters

Status code: 202

Table 5 Response body parameters

Parameter

Type

Description

instance_id

String

Gateway ID.

message

String

Information about the gateway creation task.

job_id

String

Task ID.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Creating a gateway with network and security group configurations

{
  "available_zone_ids" : [ "xx-xxx-7b", "xx-xxx-7a" ],
  "bandwidth_size" : 5,
  "description" : "test create instance",
  "eip_id" : "41f961ab-2bdd-4ca7-9b59-cfc4fcef10c9",
  "enterprise_project_id" : "0",
  "instance_name" : "apig-demo",
  "maintain_begin" : "22:00:00",
  "maintain_end" : "02:00:00",
  "security_group_id" : "36d0ec18-bd10-4da7-86f3-ad7a5ddc55d7",
  "spec_id" : "PROFESSIONAL",
  "subnet_id" : "a938121c-11c4-4c91-b983-bc9acd347bb5",
  "vpc_id" : "0957108c-257c-4ce0-9e93-527d279ce763"
}

Example Responses

Status code: 202

Accepted

{
  "instance_id" : "6a7d71827fd54572b1f31aa9548fcc81",
  "message" : "JOB_ASSIGNED_FOR_PROVISIONING_0003I:The job JOB-bdb370eb6f4c4c73b61b95a9da38beb5 has been assigned to the instance 6a7d71827fd54572b1f31aa9548fcc81 for running provisioning.",
  "job_id" : "JOB-edbac2355fb7433e98f173ea2e452e2d"
}

Status code: 400

Bad Request

{
  "error_code" : "APIC.7211",
  "error_msg" : "Parameter value does not match the rules, parameter name[maintainBegin]"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIC.7102",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "APIC.7106",
  "error_msg" : "No permissions to request for the method"
}

Status code: 404

Not Found

{
  "error_code" : "APIC.7301",
  "error_msg" : "Instance spec not found"
}

Status code: 500

Internal Server Error

{
  "error_code" : "APIC.9000",
  "error_msg" : "Failed to request internal service"
}

Status Codes

Status Code

Description

202

Accepted

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback