创建Nacos服务来源。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
mse:AddServiceSource |
create |
*Gateway
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Type |
string |
否 |
服务注册类型,按来源类型填写对应的值:
|
NACOS |
| Source |
string |
否 |
服务来源类型:
|
MSE |
| Address |
string |
否 |
访问地址(必填):
|
mse-********-nacos-ans.mse.aliyuncs.com:8848 |
| Name |
string |
否 |
名称。 说明
不同来源类型描述。
|
nacos |
| GatewayUniqueId |
string |
是 |
网关唯一 ID。 |
gw-c70622ff52fe49beb29bea9a6f52**** |
| IngressOptionsRequest |
object |
否 |
Ingress 配置(服务来源类型为 K8s 时使用)。 |
|
| EnableIngress |
boolean |
否 |
是否开启 Ingress。 |
true |
| IngressClass |
string |
否 |
监听 Ingress Class。 |
com.test.xxx |
| WatchNamespace |
string |
否 |
监听目标命名空间。 |
default |
| EnableStatus |
boolean |
否 |
是否更新 Ingress Status。 |
true |
| ToAuthorizeSecurityGroups |
array<object> |
否 |
待授权安全组列表,用于在创建来源时打通后端服务的安全组限制 |
|
|
object |
否 |
|||
| SecurityGroupId |
string |
否 |
安全组 ID。 |
sg-bp1acepclex0vmi1**** |
| PortRange |
string |
否 |
安全组的授权端口范围,可多选,使用,分隔。 |
8080/8080,9000/10000 |
| Description |
string |
否 |
授权记录描述。 |
rule for xxx |
| GroupList |
array |
否 |
服务分组列表。 |
|
|
string |
否 |
服务分组。 |
NACOS |
|
| PathList |
array |
否 |
服务根路径数组。 |
|
|
string |
否 |
服务根路径。 |
/test |
|
| AcceptLanguage |
string |
否 |
支持的语言。包括以下取值:
|
zh-CN |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
数据结构。 |
||
| RequestId |
string |
请求 ID。 |
D0DB055C-51F2-5BB2-82A6-CD8A3C6EE6BA |
| HttpStatusCode |
integer |
HTTP 状态码。 |
200 |
| Message |
string |
返回信息。 |
You are not authorized to perform this operation. Action: mse:AddServiceSource, Resource: acs:mse:cn-hangzhou:1105471854403716:instance/gw-082c943a8c304e48a37a7a29a5ddeda7 |
| Code |
integer |
返回值。 |
200 |
| Success |
boolean |
请求结果,取值如下:
|
true |
| Data |
integer |
返回数据。 |
63 |
示例
正常返回示例
JSON格式
{
"RequestId": "D0DB055C-51F2-5BB2-82A6-CD8A3C6EE6BA",
"HttpStatusCode": 200,
"Message": "You are not authorized to perform this operation. Action: mse:AddServiceSource, Resource: acs:mse:cn-hangzhou:1105471854403716:instance/gw-082c943a8c304e48a37a7a29a5ddeda7",
"Code": 200,
"Success": true,
"Data": 63
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | 非法请求: %s |
| 400 | InvalidParameter | Parameter error:%s | 请求参数错误:%s |
| 500 | InternalError | Console error. Try again later:%s | 控制台错误.稍后重试:%s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | 没有权限使用此接口:%s |
| 404 | NotFound | Not found:%s | 资源不存在:%s |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。