- What's New
- Function Overview
- Service Overview
- Billing
-
Getting Started
- Using a Public NAT Gateway to Enable Servers to Share One or More EIPs to Access the Internet
- Using a Public NAT Gateway to Enable Servers to Be Accessed by the Internet
- Using a Private NAT Gateway to Connect Cloud and On-premises Networks
- Using Multiple Public NAT Gateways Together in Performance-Demanding Scenarios
-
User Guide
- Public NAT Gateways
- Private NAT Gateways
- Permissions Management
- Tag Management
- Managing Quotas
- Monitoring
- Auditing
-
Best Practices
- Enabling Private Networks to Access the Internet Using a Cloud Connection and SNAT
- Using a Public NAT Gateway and Direct Connect to Accelerate Internet Access
- Using a Private NAT Gateway and Direct Connect to Enable Communications Between a VPC and an On-premises Data Center
- Using a Public NAT Gateway and VPC Peering to Enable Communications Between VPCs and the Internet
- Preserving Your Network with NAT Gateways During Cloud Migration
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- APIs of Public NAT Gateways
- APIs for Private NAT Gateways
- Application Examples
- Permissions Policies and Supported Actions
- Appendixes
- Out-of-Date APIs
- SDK Reference
-
FAQs
-
Public NAT Gateways
- What Is the Relationship Between a VPC, Public NAT Gateway, EIP Bandwidth, and ECS?
- How Does a Public NAT Gateway Offer High Availability?
- Which Ports Cannot Be Accessed?
- What Are the Differences Between Using a Public NAT Gateway and Using an EIP for an ECS?
- What Should I Do If I Fail to Access the Internet Through a Public NAT Gateway?
- Can I Change the VPC for a Public NAT Gateway?
- Does Public NAT Gateway Support IPv6 Addresses?
- What Security Policies Can I Configure to Implement Access Control If I Use a Public NAT Gateway?
- What Can I Do If Connection Between My Servers and the Internet Fails After I Add SNAT and DNAT Rules?
- Can a Public NAT Gateway Limit the Bandwidth of a Server?
- What Can I Do If the Number of Lost Packets of a Public NAT Gateway Exceeds the Threshold (or EIP Port Allocation Exceeds the Threshold)?
-
Private NAT Gateways
- How Do I Troubleshoot a Network Failure After a Private NAT Gateway Is Configured?
- How Many Private NAT Gateways Can I Buy in a VPC?
- Can I Increase the Numbers of SNAT and DNAT Rules Supported by a Private NAT Gateway?
- Can Private NAT Gateways Translate On-premises IP Addresses Connected to the Cloud Through Direct Connect?
- What Are the Differences Between Private NAT Gateways and Public NAT Gateways?
- Can a Private NAT Gateway Be Used Across Accounts?
-
SNAT Rules
- Why Do I Need SNAT?
- What Are SNAT Connections?
- What Is the Bandwidth of a Public NAT Gateway That Is Used by Servers to Access the Internet? How Do I Configure the Bandwidth?
- How Do I Resolve Packet Loss or Connection Failure Issues When Using a NAT Gateway?
- What Should I Do If My ECS Fails to Access a Server on the Public Network Through a Public NAT Gateway?
- What Are the Relationships and Differences Between the CIDR Blocks in a NAT Gateway and in an SNAT Rule?
- DNAT Rules
-
Public NAT Gateways
- Videos
- Glossary
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Overview
- Getting Started
- Managing NAT Gateways
- Managing SNAT Rules
- Managing DNAT Rules
- Monitoring Management
-
FAQs
-
NAT Gateway
- What Is the Relationship Between VPC, NAT Gateway, EIP Bandwidth, and ECS?
- How Does A NAT Gateway Offer High Availability?
- Which Ports Cannot Be Accessed?
- What Can I Do If I Fail to Access the Internet Through the NAT Gateway?
- Can I Change the VPC for a NAT Gateway After It Is Created?
- What Is the Quota of the NAT Gateway?
-
SNAT
- Why SNAT Is Used?
- What Are SNAT Connections?
- What Is the Bandwidth of the NAT Gateway When a Server Accesses the Internet Through the NAT Gateway? Where Can I Configure the Bandwidth?
- How Do I Resolve Packet Loss or Connection Failure Issues When Using a NAT Gateway?
- What Are the Relationships and Differences Between the CIDR Blocks in a NAT Gateway and in an SNAT Rule?
- DNAT
-
NAT Gateway
- Change History
- API Reference (ME-Abu Dhabi Region)
-
User Guide (Paris Region)
- Overview
-
Getting Started
- Allowing a Private Network to Access the Internet Using SNAT
- Allowing Internet Users to Access a Service in a Private Network Using DNAT
- Allowing On-Premises Servers to Communicate with the Internet
- Using Private NAT Gateways to Enable Communications Between Cloud and On-premises Networks
- Using Multiple Public NAT Gateways Together in Performance-Demanding Scenarios
- Public NAT Gateways
- Private NAT Gateways
- Permissions Management
- Monitoring
-
FAQs
-
Public NAT Gateways
- What Is the Relationship Between a VPC, Public NAT Gateway, EIP Bandwidth, and ECS?
- How Does a Public NAT Gateway Offer High Availability?
- Which Ports Cannot Be Accessed?
- What Are the Differences Between Using a NAT Gateway and Using an EIP for an ECS?
- What Should I Do If I Fail to Access the Internet Through a NAT Gateway?
- Can I Change the VPC for a NAT Gateway?
- What Is the Quota of the NAT Gateway?
- Can I Update NAT Gateways and SNAT Rules?
- Does NAT Gateway Support IPv6 Addresses?
- What Security Policies Can I Configure to Implement Access Control If I Use a NAT Gateway?
- What Can I Do If Connection Between My Servers and the Internet Fails After I Add SNAT and DNAT Rules?
-
Private NAT Gateways
- How Do I Troubleshoot a Network Failure After a Private NAT Gateway Is Configured?
- How Many Private NAT Gateways Can I Create in a VPC?
- Can I Increase the Numbers of SNAT and DNAT Rules Supported by a Private NAT Gateway?
- Can an SNAT Rule and a DNAT Rule of a Private NAT Gateway Share the Same Transit IP Address?
- Can Private NAT Gateways Translate On-premises IP Addresses Connected to the Cloud Through Direct Connect?
- What Are the Differences Between Private NAT Gateways and Public NAT Gateways?
- Can a Private NAT Gateway Be Used Across ?
-
SNAT Rules
- Why Do I Need SNAT?
- What Are SNAT Connections?
- What Is the Bandwidth of a NAT Gateway That Is Used by Servers to Access the Internet? How Do I Configure the Bandwidth?
- How Do I Resolve Packet Loss or Connection Failure Issues When Using a NAT Gateway?
- What Should I Do If My ECS Fails to Access a Server on the Public Network Through a NAT Gateway?
- What Are the Relationships and Differences Between the CIDR Blocks in a NAT Gateway and in an SNAT Rule?
- DNAT Rules
-
Public NAT Gateways
- Change History
- API Reference (Paris Region)
-
User Guide (Kuala Lumpur Region)
- Overview
- Getting Started
- Managing NAT Gateways
- Managing SNAT Rules
- Managing DNAT Rules
- Permissions Management
- Monitoring Management
-
FAQs
- NAT Gateway
-
SNAT
- Why Is SNAT Used?
- What Are SNAT Connections?
- What Is the Bandwidth of the NAT Gateway When a Server Accesses the Internet Through the NAT Gateway? Where Can I Configure the Bandwidth?
- How Do I Resolve Packet Loss or Connection Failure Issues When Using a NAT Gateway?
- What Are the Relationships and Differences Between the CIDR Blocks in a NAT Gateway and in an SNAT Rule?
- DNAT
- Change History
- API Reference (Kuala Lumpur Region)
-
User Guide (Ankara Region)
- Service Overview
- Getting Started
- Public NAT Gateways
- Private NAT Gateways
- Permissions Management
- Monitoring
-
FAQs
- Public NAT Gateways
-
Private NAT Gateways
- How Do I Troubleshoot a Network Failure After a Private NAT Gateway Is Configured?
- How Many Private NAT Gateways Can I Create in a VPC?
- Can Private NAT Gateways Translate On-premises IP Addresses Connected to the Cloud Through Direct Connect?
- What Are the Differences Between Private NAT Gateways and Public NAT Gateways?
- Can a Private NAT Gateway Be Used Across Accounts?
- SNAT Rules
- DNAT Rules
- Change History
-
API Reference (Ankara Region)
- Before You Start
- API Overview
- Calling APIs
- APIs for Public NAT Gateways
- Private Nat API
- Permissions Policies and Supported Actions
- Common Parameters
- Change History
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Copied.
Querying NAT Gateways by Tag
Function
This API is used to filter NAT gateways by tag.
TMS uses this API to filter and list NAT gateways by tag.
By default, NAT gateways and tags are sorted in descending order of creation time.
URI
- URI format
POST /v2.0/{project_id}/nat_gateways/resource_instances/action
- Parameter description
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the project ID. |
Request
Table 2 describes the request parameters.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
tags |
No |
Array<Object> |
Specifies the included tags. Each tag contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique. Resources identified by different keys are in AND relationship, and values in one tag are in OR relationship. If no tag filtering criteria is specified, full data is returned. |
tags_any |
No |
Array<Object> |
Specifies any included tags. Each tag contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique. Resources identified by different keys are in OR relationship, and values in one tag are in OR relationship. If no tag filtering criteria is specified, full data is returned. |
not_tags |
No |
Array<Object> |
Specifies the excluded tags. Each tag contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique. Resources not identified by different keys are in AND relationship, and values in one tag are in OR relationship. If no tag filtering criteria is specified, full data is returned. |
not_tags_any |
No |
Array<Object> |
Specifies any excluded tags. Each tag contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique. Resources not identified by different keys are in OR relationship, and values in one tag are in OR relationship. If no tag filtering criteria is specified, full data is returned. |
limit |
No |
String |
Number of records. This parameter is not available when action is set to count. The default value is 1000 when action is set to filter. The maximum value is 1000, and the minimum value is 1. The value cannot be a negative number. |
offset |
No |
String |
Specifies the index position. The query starts from the next piece of data indexed by this parameter. This parameter is not required when you query data on the first page. The value in the response returned for querying data on the previous page will be included in this parameter for querying data on subsequent pages. This parameter is not available when action is set to count. If action is set to filter, the value must be a number, and the default value is 0. The value cannot be a negative number. |
action |
Yes |
String |
Specifies the operation to perform. The value can only be filter (filtering) or count (querying the total number). The value filter indicates pagination query. The value count indicates that the total number of query results meeting the search criteria will be returned. Returning other fields is not allowed. |
matches |
No |
Array<match> |
Specifies the search criteria. The tag key is the field to match, for example, resource_name. The tag value indicates the matched value. This field is a fixed dictionary value. Determine whether fuzzy match is required based on different fields. For example, if key is resource_name, fuzzy search (case insensitive) is used by default. If value is an empty string, exact match is used. If key is resource_id, exact match is used. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Specifies the tag key. A key contains a maximum of 127 Unicode characters and cannot be blank. (The system does not check the parameter when searching a tag.) The key cannot be empty or an empty string, and cannot contain spaces. Before verification, delete spaces before and after the value. |
values |
Yes |
Array<String> |
Specifies the tag values. Each value contains a maximum of 255 Unicode characters and cannot contain spaces. Before verification, delete spaces before and after the value. The asterisk (*) is a reserved character. The value can be empty but cannot be left blank. If the value starts with an asterisk (*), the string following the asterisk is fuzzy matched. If the values are null, it indicates any_value (querying any value). The values are in OR relationship. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Specifies the tag key. The value is fixed at resource_name. |
value |
Yes |
String |
Specifies the key value. It can contain a maximum of 255 Unicode characters. |
Response
Table 5 lists response parameters.
Parameter |
Type |
Description |
---|---|---|
resources |
Array<resource> |
Specifies the resource object list. For details, see Table 6. |
total_count |
Integer |
Specifies the total number of resources. |
Parameter |
Type |
Description |
---|---|---|
resource_id |
String |
Specifies the resource ID. |
resouce_detail |
Object |
Provides details about the resource. The value is a resource object, used for extension. This parameter is left blank by default. |
tags |
Array<resource_tag> |
Specifies the list of queried tags. If no tag is matched, an empty array is returned. For details, see Table 7. |
resource_name |
String |
Specifies the resource name. This parameter is an empty string by default if there is no resource name. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Specifies the tag key. It contains a maximum of 36 Unicode characters. It cannot be left empty or contain ASCII characters (0–31) and the following special characters: *<>\= |
value |
String |
Specifies the key value. The value can contain a maximum of 43 Unicode characters and can be an empty string. It cannot contain ASCII characters (0–31) and the following characters: *<>\= |
Examples
- Example request
- Request body when action is set to filter
POST https://{VPC_endpoint}/v2.0/9ad601814ac94c80bf7bb9073ded66fc/nat_gateways/resource_instances/action { "offset": "100", "limit": "100", "action": "filter", "matches": [ { "key": "resource_name", "value": "nat_gateways" } ], "not_tags": [ { "key": "key1", "values": [ "*value1", "value2" ] } ], "tags": [ { "key": "key2", "values": [ "*value3", "value4" ] } ], "tags_any": [ { "key": "key3", "values": [ "*value5", "value6" ] } ], "not_tags_any": [ { "key": "key4", "values": [ "*value7", "value8" ] } ] }
- Request body when action is set to count
POST https://{VPC_endpoint}/v2.0/9ad601814ac94c80bf7bb9073ded66fc/nat_gateways/resource_instances/action { "action": "count", "matches": [ { "key": "resource_name", "value": "nat_gateways" } ], "not_tags": [ { "key": "key1", "values": [ "*value1", "value2" ] } ], "tags": [ { "key": "key2", "values": [ "*value3", "value4" ] } ], "tags_any": [ { "key": "key3", "values": [ "*value5", "value6" ] } ], "not_tags_any": [ { "key": "key4", "values": [ "*value7", "value8" ] } ] }
- Example response
- Response body when action is set to filter
{ "resources": [ { "resource_detail": null, "resource_id": "e5ad289f-9c56-4daf-b08b-2e53a983473a", "resource_name": "nat_gateways", "tags": [ { "key": "key2", "value": "value4" }, { "key": "key2", "value": "value3" } ] } ], "total_count": 1000 }
- Response body when action is set to count
{ "total_count": 1000 }
Status Code
See Status Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot