All Products
Search
Document Center

API Gateway:GetGateway

Last Updated:Feb 11, 2026
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 the basic information about an instance, such as the virtual private cloud (VPC) and vSwitch to which the instance belongs and its ingress.

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:GetGatewayget
*Gateway
acs:apig:{#regionId}:{#accountId}:gateway/{#GatewayId}
    none
none

Request syntax

GET /v1/gateways/{gatewayId} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
gatewayIdstringNo

The environment information.

gw-cpv4sqdl*****

Response parameters

ParameterTypeDescriptionExample
object

The environment ID.

requestIdstring

The environment name.

0F138FFC-6E2B-56C1-9BAB-A67462E339D1
codestring

The environment alias.

Ok
messagestring

Default environment

success
dataobject

The security group of the instance.

gatewayIdstring

The security group ID.

gw-cq2vundlhtg***
namestring

The security group name.

itemcenter-gateway
chargeTypestring

The vSwitch associated with the instance.

Enumeration Value:
  • POSTPAY: The vSwitch name. .
  • PREPAY: HangzhouVPCvSwitch .
POSTPAY
gatewayTypestring

The vSwitch ID.

Enumeration Value:
  • AI: AI.
  • API: API.
API
statusstring

The VPC associated with the instance.

Enumeration Value:
  • Restarting: The VPC name. .
  • Creating: HangzhouVPC .
  • Upgrading: The VPC ID. .
  • DeleteFailed: The list of zones associated with the instance. .
  • Running: The zone information. .
  • RestartFailed: The vSwitch information. .
  • Deleting: The vSwitch ID. .
  • CreateFailed: The vSwitch name. .
  • UpgradeFailed: HangzhouVPCvSwitch .
Running
specstring

The zone name.

Enumeration Value:
  • apigw.small.x1: apigw.small.x1.
apigw.small.x1
replicasstring

HangzhouZoneE

2
createTimestamplong

The zone ID.

1719386834548
updateTimestamplong

The ingress addresses of the instance.

1719386834548
expireTimestamplong

The ingress information.

1719386834548
createFromstring

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

  • Managed: Cloud-native API Gateway manages and provides the load balancer.
Enumeration Value:
  • Console: The load balancer ID. .
Console
versionstring

The load balancer IP address.

2.0.2
targetVersionstring

The load balancer address type. Valid values:

  • Internet
  • Intranet
2.0.2
environmentsarray<object>

The IP version of the address. Valid values:

  • ipv4
  • ipv6
environmentobject

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

environmentIdstring

The load balancer type. Valid values:

  • NLB: Network Load Balancer
  • CLB: Classic Load Balancer
env-cp9uhudlht***
namestring

The list of listened ports.

default-gw-cp9ugg5***
aliasstring

The port information.

The protocol. Valid values: * TCP * UDP
securityGroupobject

The port number.

securityGroupIdstring

The load balancer status. Valid values:

  • Ready: The load balancer is available.
  • NotCreate: The load balancer is not associated with the instance.
sg-bp16tafq9***
namestring

The resource group ID.

APIG-sg-gw-cq7ke5ll***
vSwitchobject

rg-aek2s3cvc4jzfxi

namestring

The resource tags.

The resource tag.
vSwitchIdstring

The tag value.

vsw-bp1c7ggkj***
vpcobject

The tag key.

namestring

=

$.errorCode
vpcIdstring

Query Gateway Details

vpc-bp1llj52lvj6xc***
zonesarray<object>

List of zone information

zoneobject

object

vSwitchobject

The VSwitch information in the zone

vSwitchIdstring

The VSwitch ID

vsw-bp1c7ggkj***
namestring

The VSwitch name

vswitch-name
namestring

The zone name

Hangzhou Zone I
zoneIdstring

The zone ID

cn-hangzhou-e
loadBalancersarray<object>

loadBalancers

loadBalancerobject

object

modestring

The mode of the load balancer

Enumeration Value:
  • Managed: Managed.
Managed
loadBalancerIdstring

The unique identifier of the load balancer

nlb-xoh3pghru7c***
addressstring

The IP address of the load balancer

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

The address type of the load balancer

Internet
addressIpVersionstring

The IP version of the load balancer address

Enumeration Value:
  • ipv4: ipv4.
  • ipv6: ipv6.
ipv4
gatewayDefaultboolean

Whether this is the default gateway ingress

true
typestring

The type of load balancer

NLB
portsarray<object>

List of port configurations for the load balancer

portobject

object

protocolstring

The protocol of the port

Enumeration Value:
  • TCP: TCP.
  • UDP: UDP.
TCP
portinteger

The listening port number

443
statusstring

The current status of the load balancer

Enumeration Value:
  • Ready: Ready.
Ready
ipv4Addressesarray

List of IPv4 addresses

ipv4Addressstring

string

["172.16.0.10", "172.16.0.11"]
ipv6Addressesarray

List of IPv6 addresses

ipv6Addressstring

string

["2001:db8::1", "2001:db8::2"]
resourceGroupIdstring

The resource group ID

rg-acfm2ij6pwxsvua
tagsarray<object>

List of tags associated with the gateway

tagobject

object

valuestring

The tag value

zhangsan
keystring

The tag key

owner
ispstring

The ISP type for traffic routing

BGP
gatewayEditionstring

gatewayEdition

Serverless
maintenancePeriodobject

The maintenance period configuration

startTimestring

The maintenance start time

02:00
endTimestring

The maintenance end time

06:00

Examples

Sample success responses

JSONformat

{
  "requestId": "0F138FFC-6E2B-56C1-9BAB-A67462E339D1",
  "code": "Ok",
  "message": "success",
  "data": {
    "gatewayId": "gw-cq2vundlhtg***",
    "name": "itemcenter-gateway",
    "chargeType": "POSTPAY",
    "gatewayType": "API",
    "status": "Running",
    "spec": "apigw.small.x1",
    "replicas": 2,
    "createTimestamp": 1719386834548,
    "updateTimestamp": 1719386834548,
    "expireTimestamp": 1719386834548,
    "createFrom": "Console",
    "version": "2.0.2",
    "targetVersion": "2.0.2",
    "environments": [
      {
        "environmentId": "env-cp9uhudlht***",
        "name": "default-gw-cp9ugg5***",
        "alias": "The protocol. Valid values:\n\n*   TCP\n*   UDP\n"
      }
    ],
    "securityGroup": {
      "securityGroupId": "sg-bp16tafq9***",
      "name": "APIG-sg-gw-cq7ke5ll***"
    },
    "vSwitch": {
      "name": "The resource tag.\n",
      "vSwitchId": "vsw-bp1c7ggkj***"
    },
    "vpc": {
      "name": "$.errorCode",
      "vpcId": "vpc-bp1llj52lvj6xc***"
    },
    "zones": [
      {
        "vSwitch": {
          "vSwitchId": "vsw-bp1c7ggkj***",
          "name": "vswitch-name"
        },
        "name": "Hangzhou Zone I",
        "zoneId": "cn-hangzhou-e"
      }
    ],
    "loadBalancers": [
      {
        "mode": "Managed",
        "loadBalancerId": "nlb-xoh3pghru7c***",
        "address": "nlb-xoh3pghr***.cn-hangzhou.nlb.aliyuncs.com",
        "addressType": "Internet",
        "addressIpVersion": "ipv4",
        "gatewayDefault": true,
        "type": "NLB",
        "ports": [
          {
            "protocol": "TCP",
            "port": 443
          }
        ],
        "status": "Ready",
        "ipv4Addresses": [
          [
            "172.16.0.10",
            "172.16.0.11"
          ]
        ],
        "ipv6Addresses": [
          [
            "2001:db8::1",
            "2001:db8::2"
          ]
        ]
      }
    ],
    "resourceGroupId": "rg-acfm2ij6pwxsvua",
    "tags": [
      {
        "value": "zhangsan",
        "key": "owner"
      }
    ],
    "isp": "BGP",
    "gatewayEdition": "Serverless",
    "maintenancePeriod": {
      "startTime": "02:00",
      "endTime": "06:00"
    }
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2025-10-29The response structure of the API has changedView Change Details
2025-07-18The response structure of the API has changedView Change Details
2025-06-11The response structure of the API has changedView Change Details
2024-11-21The response structure of the API has changedView Change Details
2024-11-20The response structure of the API has changedView Change Details