All Products
Search
Document Center

API Gateway:ServiceConfig

Last Updated:Nov 05, 2024

Lists the information about the backend service being called.

Node

ServiceConfig

Subnode

Parameter

Type

Required

Description

Example

ServiceProtocol

String

Yes

The backend service type. Valid values:

HTTP: The backend service receives requests over HTTP or a virtual private cloud (VPC).

FunctionCompute: The backend service is Function Compute.

OSS: The backend service is Object Storage Service (OSS).

EventBridge: The backend service is EventBridge.

UN_SPECIFIED: The backend service type is MIXED.

HTTP

ServiceAddress

String

No

The URL of the backend service.

http://www.customerdomain.com

ServicePath

String

No

The backend service path.

/v3/getUserTest/[userId]

ServiceHttpMethod

String

No

The HTTP method that is used to call a backend service. Valid values: GET, POST, DELETE, PUT, HEADER, TRACE, PATCH, CONNECT, and OPTIONS.

GET

ServiceTimeout

String

Yes

The timeout period of the backend service, in millisecond.

1000

ContentTypeCatagory

String

No

The policy based on which the value of the ContentType header is determined if the ServiceProtocol parameter is set to HTTP. If the value of this parameter is DEFAULT, the default value provided by API Gateway is used. If the value of this parameter is CUSTOM, you can define a custom value. If the value of this parameter is CLIENT, the value of the ContentType header in the request sent by the client is used.

DEFAULT

ContentTypeValue

String

No

The value of the ContentType header if the ServiceProtocol parameter is set to HTTP and the ContentTypeCatagory parameter is set to DEFAULT or CUSTOM.

application/json

Mock

String

No

Specifies whether to enable the Mock mode. Valid values: TRUE and FALSE.

FALSE

MockResult

String

No

The result that is returned if the Mock parameter is set to TRUE.

{"name":"xiaoming"}

ServiceVpcEnable

Boolean

No

Specifies whether to enable VPC access. Valid values: TRUE and FALSE. A value of TRUE specifies that VPC access is enabled. A value of FALSE specifies that you must create a VPC access authorization to enable VPC access.

TRUE

VpcConfig

String

No

The VPC access configurations if VPC access is enabled. For more information, see VpcConfig.

{"VpcId":"vpc-uf657qec7lx42paw3qxxx","InstanceId":"i-uf6bzcg1pr4oh5jjmxxx","Port":80,"Name":"test"}

FunctionComputeConfig

String

No

The Function Compute configurations if ServiceProtocol is set to FunctionCompute. For more information, see FunctionComputeConfig.

{"Path": "/test/api","ContentTypeValue": "application/x-www-form-urlencoded; charset=UTF-8", "FcVersion": "2.0","FcType": "HttpTrigger","Method": "GET","OnlyBusinessPath": false,"FcRegionId": "cn-hangzhou","RoleArn": "acs:ram::12274XXXXX:role/aliyunserviceroleforapigateway","FcBaseUrl": "https://122746XXXX.cn-hangzhou-internal.fc.aliyuncs.com/2016-08-15/proxy/testService2.LATEST/testHttpTrigger/","ContentTypeCatagory": "DEFAULT"}