All Products
Search
Document Center

API Gateway:ListGateways

Last Updated:Mar 20, 2025
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Queries a list of instances.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
apig:ListGatewayslist
*Gateway
acs:apig:{#regionId}:{#accountId}:gateway/*
    none
none

Request syntax

GET /v1/gateways HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
gatewayIdstringNo

The instance ID. If you specify an ID, an exact search is performed.

gw-cpv4sqdl****
pageNumberintegerNo

The number of the page to return.

1
pageSizeintegerNo

The number of entries per page.

10
namestringNo

The instance name. If you specify a name, an exact search is performed.

itemcenter-gateway
keywordstringNo

The search keyword. A full match is performed. The search is case-insensitive.

dev
resourceGroupIdstringNo

The resource group ID.

rg-aekz3wes3hnre5a
tagarray<object>No

The tags that you want to use for the search.

objectNo

The tag.

keystringNo

The key of tag N.

owner
valuestringNo

The value of tag N.

zhangsan

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

requestIdstring

The request ID.

5B626361-070A-56A7-B127-ADAC8F3655DB
codestring

The status code.

Ok
messagestring

The returned message.

success
dataobject

The instances.

pageNumberinteger

The page number of the returned page.

1
pageSizeinteger

The number of entries per page.

10
totalSizelong

The total number of entries returned.

6
itemsarray<object>

The instances.

gatewayobject

The information about the instance.

gatewayIdstring

The instance ID.

gw-cpv54p5***
namestring

The instance name.

itemcenter-gateway
chargeTypestring

The billing method. Valid values:

  • POSTPAY: pay-as-you-go
  • PREPAY: subscription
POSTPAY
statusstring

The instance state. Valid values:

  • Running: The instance is running.
  • Creating: The instance is being created.
  • CreateFailed: The instance fails to be created.
  • Upgrading: The instance is being upgraded.
  • UpgradeFailed: The instance fails to be upgraded.
  • Restarting: The instance is being restarted.
  • RestartFailed: The instance fails to be restarted.
  • Deleting: The instance is being released.
  • DeleteFailed: The instance failed to be released.
Running
specstring

The instance specification. Valid values:

  • apigw.small.x1
apigw.small.x1
replicasstring

The node quantity of the instance.

2
createTimestamplong

The time when the instance was created. This value is a UNIX timestamp. Unit: milliseconds.

1719386834548
updateTimestamplong

The time when the instance was last updated. This value is a UNIX timestamp. Unit: milliseconds.

1719386834548
expireTimestamplong

The time when the instance expires. This value is a UNIX timestamp. Unit: milliseconds.

172086834548
createFromstring

The creation source of the instance. Valid values:

  • Console
Console
versionstring

The instance version.

2.0.2
targetVersionstring

The destination version of the instance. If the value is inconsistent with the current version, you can upgrade the instance.

2.0.2
loadBalancersarray<object>

The ingress addresses of the instance.

loadBalancerobject

The ingress address.

loadBalancerIdstring

The load balancer ID.

nlb-xqwioje1c91r***
addressTypestring

The address type. Valid values:

  • Internet
  • Intranet
Internet
typestring

The load balancer type. Valid values:

  • NLB: Network Load Balancer
  • CLB: Classic Load Balancer
NLB
statusstring

The load balancer status. Valid values:

  • Ready: The load balancer is available.
  • NotCreate: The load balancer is not associated with the instance.
Ready
addressstring

The load balancer IP address.

nlb-xoh3pghr***.cn-hangzhou.nlb.aliyuncs.com
addressIpVersionstring

The IP version of the address. Valid values:

  • ipv4: IPv4
  • ipv6: IPv6
ipv4
modestring

The mode in which the load balancer is provided. Valid values:

  • Managed: Cloud-native API Gateway manages and provides the load balancer.
Managed
gatewayDefaultboolean

Indicates whether the address is the default ingress address of the instance.

true
portsarray<object>

The list of listened ports.

portobject

The information about the port.

protocolstring

The protocol. Valid values:

  • TCP
  • UDP
TCP
portinteger

The port number.

443
securityGroupobject

The security group information about the instance.

securityGroupIdstring

The security group ID.

sg-xxxx
zonesarray<object>

The availability zones of the instance.

zoneobject

The information about the zone.

zoneIdstring

The zone ID.

cn-hangzhou-f
vSwitchobject

The vSwitch information.

vSwitchIdstring

The vSwitch ID.

vsw-xxxxx
vSwitchobject

The vSwitch information.

vSwitchIdstring

The vSwitch ID.

vsw-xxxxx
vpcobject

The virtual private cloud (VPC) information of the instance.

vpcIdstring

The VPC ID.

vpc-xxxxx
resourceGroupIdstring

The resource group ID.

rg-xxx
tagsarray<object>

The tags.

tagobject

The tag.

keystring

The tag key.

owner
valuestring

The tag value.

zhangsan
subDomainInfosarray

The second-level domain names.

subDomainInfoSubDomainInfo

The second-level domain name.

Examples

Sample success responses

JSONformat

{
  "requestId": "5B626361-070A-56A7-B127-ADAC8F3655DB",
  "code": "Ok",
  "message": "success",
  "data": {
    "pageNumber": 1,
    "pageSize": 10,
    "totalSize": 6,
    "items": [
      {
        "gatewayId": "gw-cpv54p5***",
        "name": "itemcenter-gateway",
        "chargeType": "POSTPAY",
        "status": "Running",
        "spec": "apigw.small.x1",
        "replicas": "2",
        "createTimestamp": 1719386834548,
        "updateTimestamp": 1719386834548,
        "expireTimestamp": 172086834548,
        "createFrom": "Console",
        "version": "2.0.2",
        "targetVersion": "2.0.2",
        "loadBalancers": [
          {
            "loadBalancerId": "nlb-xqwioje1c91r***",
            "addressType": "Internet",
            "type": "NLB",
            "status": "Ready",
            "address": "nlb-xoh3pghr***.cn-hangzhou.nlb.aliyuncs.com\n",
            "addressIpVersion": "ipv4",
            "mode": "Managed",
            "gatewayDefault": true,
            "ports": [
              {
                "protocol": "TCP",
                "port": 443
              }
            ]
          }
        ],
        "securityGroup": {
          "securityGroupId": "sg-xxxx"
        },
        "zones": [
          {
            "zoneId": "cn-hangzhou-f",
            "vSwitch": {
              "vSwitchId": "vsw-xxxxx"
            }
          }
        ],
        "vSwitch": {
          "vSwitchId": "vsw-xxxxx"
        },
        "vpc": {
          "vpcId": "vpc-xxxxx\n"
        },
        "resourceGroupId": "rg-xxx",
        "tags": [
          {
            "key": "owner",
            "value": "zhangsan"
          }
        ],
        "subDomainInfos": [
          {
            "domainId": "",
            "name": "",
            "protocol": "",
            "networkType": ""
          }
        ]
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-01-22The response structure of the API has changedView Change Details
2024-12-03The request parameters of the API has changed. The response structure of the API has changedView Change Details
2024-11-20The request parameters of the API has changed. The response structure of the API has changedView Change Details
2024-08-06The response structure of the API has changedView Change Details