Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying the Runtime Definition of an API

Updated on 2022-09-01 GMT+08:00

Function

This API is used to query the runtime definition of an API in a specified environment. The runtime definition of an API in the RELEASE environment is queried if no environment is specified.

The definition of an API is classified into the following types:

  • Temporary definition: definition of an API used after the API was last edited.
  • Runtime definition: snapshot of the temporary definition of an API captured when the API is published in an environment.

The runtime definition of an API is accessed when the API is called in an environment.

URI

The following table lists the HTTP/HTTPS request method and URI of the API.

Table 1 HTTP/HTTPS request method and URI

Request Method

URI

GET

/v1.0/apigw/apis/runtime/{id}[?env_id]

NOTE:
  • A combination of different query conditions can be added at the end of the URI by using question marks (?) and ampersands (&).
  • The query condition is env_id.

The following table lists the parameter in the URI.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

id

Yes

String

API ID

Request

Table 3 Parameter description

Parameter

Mandatory

Type

Description

env_id

No

String

ID of the environment in which the API is published

Response

Table 4 Parameter description

Parameter

Type

Description

id

String

API ID

name

String

API name

group_id

String

ID of the API group to which the API belongs

group_name

String

Name of the API group to which the API belongs

type

Integer

API type

version

String

API version

req_protocol

String

Request protocol

req_method

String

Request method

req_uri

String

Access address

auth_type

String

Security authentication mode

auth_opt

Object

Security authentication mode parameter

authorizer_id

String

ID of the frontend custom authorizer

match_mode

String

Matching mode

remark

String

Description of the API

bakend_type

String

Backend type

run_env_name

String

Name of the environment in which the API has been published

run_env_id

String

ID of the environment in which the API has been published

publish_id

String

ID of the publication record

tag

String

Service name tag, which is to be discarded

tags

[]String

API tags

cors

Bool

Indicates whether CORS is supported.

body_remark

String

Description of the API request body, which can be an example request body, media type, or parameter information

result_normal_sample

String

Example response for a successful request

result_failure_sample

String

Example response for a failed request

response_id

String

ID of the gateway response

sl_domain

String

Subdomain name of the API group

sl_domains

Array of strings

List of subdomain names bound to the API group

req_params

Dictionary

Request parameter list

Table 5 Parameter description of req_params

Parameter

Type

Description

id

String

Parameter ID

name

String

Parameter name

type

String

Parameter type

location

String

Parameter location

default_value

String

Default value

sample_value

String

Example value

required

Integer

Indicates whether the parameter is mandatory.

valid_enable

Integer

Indicates whether validity check is enabled.

remark

String

Description of the parameter

enumerations

String

Enumerated value

min_num

Integer

Minimum value, which is valid when the parameter type is NUMBER

max_num

Integer

Maximum value, which is valid when the parameter type is NUMBER

min_size

Integer

Minimum length

max_size

Integer

Maximum length

regular

String

Regular expression validation rule

json_schema

String

JSON validation rule

Table 6 Parameter description of auth_opt

Parameter

Type

Description

app_code_auth_type

String

Indicates whether AppCode authentication is enabled.

Example response:

{
  "name": "market_api01",
  "type": 1,
  "version": "V0.0.1",
  "req_protocol": "HTTPS",
  "req_method": "GET",
  "req_uri": "/test01",
  "auth_type": "APP",
  "auth_opt": {
    "app_code_auth_type": "HEADER"
  },
  "tags": ["APIG-SN-test", "test"],
  "cors": true,
  "match_mode": "NORMAL",
  "backend_type": "MOCK",
  "remark": "market_api01",
  "group_id": "7f848adc971749cda9c6aff3877cfc3e",
  "body_remark": "market_api01",
  "result_normal_sample": "success",
  "result_failure_sample": "",
  "id": "0e51b689e0784bc884f43756bbf34fa5",
  "group_name": "market_group01",
  "run_env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID",
  "run_env_name": "RELEASE",
  "publish_id": "f07eb9f5e5ba4bbfbe89326f5cae99c7",
  "sl_domain": "61297835ff1e4905b6f635dbcdf1777e.apigw.example.com",
  "sl_domains": ["61297835ff1e4905b6f635dbcdf1777e.apigw.example.com", "61297835ff1e4905b6f635dbcdf1777e.apigw.example.cn"],
  "req_params": [
    {
      "name": "project_id",
      "type": "STRING",
      "location": "PATH",
      "default_value": "",
      "sample_value": "",
      "required": 1,
      "valid_enable": 2,
      "remark": "",
      "enumerations": "",
      "min_num": 0,
      "max_num": 0,
      "min_size": 0,
      "max_size": 0,
      "regular": "",
      "json_schema": "",
      "id": "2a61905ea2304186a9422faba2940735"
    }
  ]
}

Status Codes

Table 7 Status codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback