全部產品
Search
文件中心

API Gateway:GetEnvironment

更新時間:Jul 03, 2026

查詢環境。

說明

目前該API介面已標記為棄用。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

apig:GetEnvironment

none

*Environment

acs:apig:{#regionId}:{#accountId}:environment/{#EnvironmentId}

請求文法

GET /v1/environments/{environmentId} HTTP/1.1

路徑參數

名稱

類型

必填

描述

樣本值

environmentId

string

環境 ID。

env-cq7l5s5lhtgi6qasrdc0

請求參數

名稱

類型

必填

描述

樣本值

withVpcInfo

boolean

標誌是否攜帶 VPC 資訊。

true

withStatistics

boolean

是否返回線上資源資訊。

true

返回參數

名稱

類型

描述

樣本值

object

Schema of Response

requestId

string

請求 ID,用於追溯 API 呼叫鏈路。

3F8EE674-BB08-5E92-BE6F-E4756A748B0F

code

string

回應碼。

Ok

message

string

回應訊息。

success

data

object

回應資料。

environmentId

string

環境 ID。

env-cq7l5s5lhtgi6qasrdc0

name

string

環境名稱。

test

alias

string

環境別名。

测试环境

description

string

環境描述資訊。

这是xxx的xx项目测试环境

gatewayInfo GatewayInfo

閘道資訊。

subDomainInfos

array

子網域列表。

SubDomainInfo

子網域資訊。

default

boolean

是否預設環境。

true

createTimestamp

integer

建立時間戳記。

1719386834548

updateTimestamp

integer

更新時間戳記。

1719386834548

resourceGroupId

string

資源群組 ID。

rg-aekz4us4iruleja

statisticsInfo

object

線上資源資訊。

totalCount

integer

總筆數。

1

resourceStatistics

array

線上資源數量。

ResourceStatistic

資源統計。

樣本

正常返回樣本

JSON格式

{
  "requestId": "3F8EE674-BB08-5E92-BE6F-E4756A748B0F",
  "code": "Ok",
  "message": "success",
  "data": {
    "environmentId": "env-cq7l5s5lhtgi6qasrdc0\n",
    "name": "test",
    "alias": "测试环境",
    "description": "这是xxx的xx项目测试环境",
    "gatewayInfo": {
      "gatewayId": "gw-cq7og15lhtgi6qasrj60",
      "name": "apitest-gw",
      "vpcInfo": {
        "vpcId": "vpc-uf664nyle5kh***",
        "name": "商品中心预发环境专有网络"
      },
      "engineVersion": "2.0.7",
      "gatewayEdition": "MultiTenantServerless"
    },
    "subDomainInfos": [
      {
        "domainId": "d-cpudb0llhtgl2djvq2sg",
        "name": "abc.com",
        "protocol": "HTTP",
        "networkType": "Intranet"
      }
    ],
    "default": true,
    "createTimestamp": 1719386834548,
    "updateTimestamp": 1719386834548,
    "resourceGroupId": "rg-aekz4us4iruleja",
    "statisticsInfo": {
      "totalCount": 1,
      "resourceStatistics": [
        {
          "resourceType": "HttpApi",
          "resourceCount": 10
        }
      ]
    }
  }
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情