All Products
Search
Document Center

API Gateway:GetGateway

Last Updated:Dec 17, 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 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 instance ID.

gw-cpv4sqdl*****

Response parameters

ParameterTypeDescriptionExample
object

The response data.

requestIdstring

The request ID.

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

The status code.

Ok
messagestring

The response message returned.

success
dataobject

The returned data.

gatewayIdstring

The instance ID.

gw-cq2vundlhtg***
namestring

The instance name.

itemcenter-gateway
chargeTypestring

The billing method. Valid values:

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

the gateway type, which is categorized into the following two types:

  • API: indicates an API gateway
  • AI: Indicates an AI gateway
API
statusstring

The instance state. Valid values:

  • Running: The instance is running.
  • Creating: The instance is being created.
  • CreateFailed: The instance failed to be created.
  • Upgrading: The instance is being upgraded.
  • UpgradeFailed: The instance failed to be upgraded.
  • Restarting: The instance is being restarted.
  • RestartFailed: The instance failed 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 creation timestamp. Unit: milliseconds.

1719386834548
updateTimestamplong

The last update timestamp. Unit: milliseconds.

1719386834548
expireTimestamplong

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

1719386834548
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 version value, you can upgrade the instance.

2.0.2
environmentsarray<object>

The list of environments associated with the instance.

environmentobject

The environment information.

environmentIdstring

The environment ID.

env-cp9uhudlht***
namestring

The environment name.

default-gw-cp9ugg5***
aliasstring

The environment alias.

Default environment
securityGroupobject

The security group of the instance.

securityGroupIdstring

The security group ID.

sg-bp16tafq9***
namestring

The security group name.

APIG-sg-gw-cq7ke5ll***
vSwitchobject

The vSwitch associated with the instance.

namestring

The vSwitch name.

HangzhouVPCvSwitch
vSwitchIdstring

The vSwitch ID.

vsw-bp1c7ggkj***
vpcobject

The VPC associated with the instance.

namestring

The VPC name.

HangzhouVPC
vpcIdstring

The VPC ID.

vpc-bp1llj52lvj6xc***
zonesarray<object>

The list of zones associated with the instance.

zoneobject

The zone information.

zoneIdstring

The zone ID.

cn-hangzhou-e
namestring

The zone name.

HangzhouZoneE
vSwitchobject

The vSwitch information.

vSwitchIdstring

The vSwitch ID.

vsw-bp1c7ggkj***
namestring

The vSwitch name.

HangzhouVPCvSwitch
loadBalancersarray<object>

The ingress addresses of the instance.

loadBalancerobject

The ingress information.

loadBalancerIdstring

The load balancer ID.

nlb-xoh3pghru7c***
addressTypestring

The load balancer address type. Valid values:

  • Internet
  • Intranet
Internet
statusstring

The load balancer status. Valid values:

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

The load balancer type. Valid values:

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

The load balancer IP address.

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

The IP version of the address. Valid values:

  • ipv4
  • 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 port information.

protocolstring

The protocol. Valid values:

  • TCP
  • UDP
TCP
portinteger

The port number.

443
resourceGroupIdstring

The resource group ID.

rg-aek2s3cvc4jzfxi
tagsarray<object>

The resource tags.

tagobject

The resource tag.

keystring

The tag key.

owner
valuestring

The tag value.

zhangsan

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": "Default environment\n"
      }
    ],
    "securityGroup": {
      "securityGroupId": "sg-bp16tafq9***",
      "name": "APIG-sg-gw-cq7ke5ll***"
    },
    "vSwitch": {
      "name": "HangzhouVPCvSwitch\n",
      "vSwitchId": "vsw-bp1c7ggkj***"
    },
    "vpc": {
      "name": "HangzhouVPC\n",
      "vpcId": "vpc-bp1llj52lvj6xc***"
    },
    "zones": [
      {
        "zoneId": "cn-hangzhou-e",
        "name": "HangzhouZoneE\n",
        "vSwitch": {
          "vSwitchId": "vsw-bp1c7ggkj***",
          "name": "HangzhouVPCvSwitch\n"
        }
      }
    ],
    "loadBalancers": [
      {
        "loadBalancerId": "nlb-xoh3pghru7c***",
        "addressType": "Internet",
        "status": "Ready",
        "type": "NLB",
        "address": "nlb-xoh3pghr***.cn-hangzhou.nlb.aliyuncs.com",
        "addressIpVersion": "ipv4",
        "mode": "Managed",
        "gatewayDefault": true,
        "ports": [
          {
            "protocol": "TCP",
            "port": 443
          }
        ]
      }
    ],
    "resourceGroupId": "rg-aek2s3cvc4jzfxi",
    "tags": [
      {
        "key": "owner",
        "value": "zhangsan"
      }
    ]
  }
}

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