调用GetDataServicePublishedApi查询数据服务API的发布态信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 |
类型 |
是否必选 |
示例值 |
描述 |
Action | String | 是 | GetDataServicePublishedApi |
系统规定参数。取值:GetDataServicePublishedApi。 |
ProjectId | Long | 是 | 10002 |
工作空间的ID。 |
TenantId | Long | 否 | 10003 |
租户ID。您可登录DataWorks控制台,进入数据开发(DataStudio)页面,单击右上方当前登录用户名称,选择菜单 > 用户信息,获取租户ID。 |
ApiId | Long | 是 | 10001 |
API的ID。 |
返回数据
名称 |
类型 |
示例值 |
描述 |
HttpStatusCode | Integer | 200 |
HTTP状态码。 |
RequestId | String | 0000-ABCD-EFG**** |
请求ID,一次请求的唯一标识。 |
ErrorMessage | String | The connection does not exist. |
错误信息。 |
Success | Boolean | true |
调用是否成功。 |
ErrorCode | String | Invalid.Tenant.ConnectionNotExists |
错误码。 |
Data | Object |
API的最新发布态信息。 |
|
Timeout | Integer | 10000 |
超时时间,单位为毫秒(ms)。 |
Status | Integer | 1 |
API的状态,可选枚举值包括0(未发布)和1(已发布)。 |
ApiId | Long | 10000 |
数据服务API的ID。 |
ApiMode | Integer | 0 |
API的类型,可选枚举值包括0(向导API)、1(脚本API)和2(注册API)。 |
ProjectId | Long | 10001 |
工作空间的ID。 |
ResponseContentType | Integer | 0 |
API的返回数据类型,可选枚举值包括0(JSON)和1(XML)。向导和脚本API支持JSON,注册API支持JSON和XML。 |
CreatorId | String | 1234567 |
创建人的阿里云ID。 |
VisibleRange | Integer | 0 |
可见范围,可选枚举值包括0(工作空间)和1(私有)。 |
ModifiedTime | String | 2020-06-23T00:21:01+0800 |
最新修改时间。 |
OperatorId | String | 2345678 |
最新编辑人的阿里云ID。 |
GroupId | String | ab12** |
分组ID。 |
Description | String | 测试API描述 |
描述信息。 |
RequestMethod | Integer | 0 |
API的请求方式,可选枚举值包括0(GET)、1(POST)、2(PUT)和3(DELTE)。向导和脚本API支持GET和POST。注册API支持GET、POST、PUT和DELETE。 |
CreatedTime | String | 2020-06-23T00:21:01+0800 |
创建时间。 |
ApiName | String | 测试API名称 |
API的名称。 |
TenantId | Long | 10001 |
租户ID。 |
ApiPath | String | /test/1 |
API的路径。 |
Protocols | Array of Integer | 0 |
API协议,多值列表,可选枚举值包括0(HTTP)和1(HTTPS)。 |
RegistrationDetails | Object |
注册API详情,只有注册API返回。 |
|
ServiceHost | String | http://www.abc.com |
后端服务地址。 |
ServiceContentType | Integer | 0 |
API的返回数据类型,可选枚举值包括0(JSON)和1(XML)。向导和脚本API支持JSON,注册API支持JSON和XML。 |
ServicePath | String | /index |
后端服务路径。 |
SuccessfulResultSample | String | {“success”: true} |
正常返回示例。 |
FailedResultSample | String | {“success”: false} |
错误返回示例。 |
ServiceRequestBodyDescription | String | {“abc”:1} |
后端请求body内容的描述。 |
RegistrationErrorCodes | Array of RegistrationErrorCode |
注册API的错误码列表。 |
|
ErrorMessage | String | The connection does not exist. |
错误信息。 |
ErrorCode | String | Invalid.Tenant.ConnectionNotExists |
错误码。 |
ErrorSolution | String | retry |
错误解决方案。 |
RegistrationRequestParameters | Array of RegistrationRequestParameter |
注册API的请求参数列表。 |
|
ParameterName | String | name1 |
参数的名称。 |
ParameterPosition | Integer | 0 |
参数的位置,可选枚举值包括0(Path)、1(Query)、2(Head)和3(Body)。向导和脚本API仅支持Query。注册API中的GET、DELETE方法支持Query、Head,PUT、POST方法支持Query、Head和Body。 |
ParameterDescription | String | description1 |
描述信息。 |
DefaultValue | String | default1 |
默认值。 |
ParameterOperator | Integer | 0 |
运算符,可选枚举值包括0(Equal)、1(Like)、2(Const)和3(In)。向导模式API支持Equal、Like和In,脚本模式API支持Equal,注册API支持Equal和Const。 |
ExampleValue | String | example1 |
示例值。 |
ParameterDataType | Integer | 0 |
数据类型,可选枚举值:
|
IsRequiredParameter | Boolean | true |
是否必填。 |
ScriptDetails | Object |
脚本API详情,只有脚本API返回。 |
|
IsPagedResponse | Boolean | true |
返回是否分页。 |
SuccessfulResultSample | String | {“success”: true} |
正常返回示例。 |
FailedResultSample | String | {“success”: false} |
错误返回示例。 |
Script | String | select a from t |
SQL脚本。 |
ScriptErrorCodes | Array of ScriptErrorCode |
脚本API的错误码列表。 |
|
ErrorMessage | String | fail to call |
错误信息 |
ErrorCode | String | 1001 |
错误码 |
ErrorSolution | String | retry |
错误解决方案 |
ScriptRequestParameters | Array of ScriptRequestParameter |
脚本API的请求参数列表。 |
|
ParameterName | String | param1 |
参数名称 |
ParameterPosition | Integer | 0 |
参数位置,可选枚举值有:
向导和脚本API,只支持Query;注册API,GET、DELETE方法支持Query、Head,PUT、POST方法支持Query、Head、Body。 |
ParameterDescription | String | description1 |
描述 |
DefaultValue | String | default1 |
默认值 |
ParameterOperator | Integer | 0 |
运算符,可选枚举值有:
向导API支持Equal、Like、In;脚本API支持Equal;注册API支持Equal、Const。 |
ExampleValue | String | example1 |
示例值 |
ParameterDataType | Integer | 0 |
数据类型,可选枚举值:
|
IsRequiredParameter | Boolean | true |
是否必填 |
ScriptResponseParameters | Array of ScriptResponseParameter |
脚本API的返回参数列表。 |
|
ParameterDescription | String | description2 |
描述信息。 |
ParameterName | String | param2 |
参数的名称。 |
ExampleValue | String | example2 |
示例值。 |
ParameterDataType | Integer | 0 |
数据类型,可选枚举值:
|
ScriptConnection | Object |
脚本API的数据源信息。 |
|
TableName | String | t |
数据源的表名称。 |
ConnectionId | Long | 123 |
数据源的ID。 |
WizardDetails | Object |
向导API详情,只有向导API返回。 |
|
IsPagedResponse | Boolean | true |
返回是否分页。 |
SuccessfulResultSample | String | {“success”: true} |
正常返回示例。 |
FailedResultSample | String | {“success”: false} |
错误返回示例。 |
WizardErrorCodes | Array of WizardErrorCode |
向导API的错误码列表。 |
|
ErrorMessage | String | fail to call |
错误信息。 |
ErrorCode | String | 1001 |
错误码。 |
ErrorSolution | String | retry |
错误解决方案。 |
WizardRequestParameters | Array of WizardRequestParameter |
向导API的请求参数列表。 |
|
ParameterName | String | param1 |
参数的名称。 |
ParameterPosition | Integer | 0 |
参数的位置,可选枚举值包括0(Path)、1(Query)、2(Head)和3(Body)。向导和脚本API仅支持Query。注册API中的GET、DELETE方法支持Query、Head,PUT、POST方法支持Query、Head和Body。 |
ParameterDescription | String | description1 |
描述信息。 |
DefaultValue | String | default1 |
默认值。 |
ParameterOperator | Integer | 0 |
运算符,可选枚举值包括0(Equal)、1(Like)、2(Const)和3(In)。向导模式API支持Equal、Like和In,脚本模式API支持Equal,注册API支持Equal和Const。 |
ExampleValue | String | example1 |
示例值。 |
ParameterDataType | Integer | 0 |
数据类型,可选枚举值:
|
IsRequiredParameter | Boolean | true |
是否必填。 |
WizardResponseParameters | Array of WizardResponseParameter |
向导API的返回参数列表。 |
|
ParameterDescription | String | description2 |
描述信息。 |
ParameterName | String | param2 |
参数的名称。 |
ExampleValue | String | example2 |
示例值。 |
ParameterDataType | Integer | 0 |
数据类型,可选枚举值:
|
WizardConnection | Object |
向导API的数据源信息。 |
|
TableName | String | t |
数据源的表名称。 |
ConnectionId | Long | 123 |
数据源的ID。 |
不同类型API的详情信息通过不同字段返回。向导API使用WizardDetails字段,脚本API使用ScriptDetails字段,注册API使用RegistrationDetails字段。
示例
请求示例
http(s)://[Endpoint]/?Action=GetDataServicePublishedApi
&ProjectId=10002
&TenantId=10003
&ApiId=10001
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
200
0000-ABCD-EFG****
The connection does not exist.
true
Invalid.Tenant.ConnectionNotExists
10000
1
10000
0
10001
0
1234567
0
2020-06-23T00:21:01+0800
2345678
ab12**
测试API描述
0
2020-06-23T00:21:01+0800
测试API名称
10001
/test/1
0
http://www.abc.com
0
/index
{"success": true}
{"success": false}
{"abc":1}
The connection does not exist.
Invalid.Tenant.ConnectionNotExists
retry
name1
0
description1
default1
0
example1
0
true
true
{"success": true}
{"success": false}
select a from t
fail to call
1001
retry
param1
0
description1
default1
0
example1
0
true
description2
param2
example2
0
t
123
true
{"success": true}
{"success": false}
fail to call
1001
retry
param1
0
description1
default1
0
example1
0
true
description2
param2
example2
0
t
123
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"HttpStatusCode" : 200,
"RequestId" : "0000-ABCD-EFG****",
"ErrorMessage" : "The connection does not exist.",
"Success" : true,
"ErrorCode" : "Invalid.Tenant.ConnectionNotExists",
"Data" : {
"Timeout" : 10000,
"Status" : 1,
"ApiId" : 10000,
"ApiMode" : 0,
"ProjectId" : 10001,
"ResponseContentType" : 0,
"CreatorId" : 1234567,
"VisibleRange" : 0,
"ModifiedTime" : "2020-06-23T00:21:01+0800",
"OperatorId" : 2345678,
"GroupId" : "ab12**",
"Description" : "测试API描述",
"RequestMethod" : 0,
"CreatedTime" : "2020-06-23T00:21:01+0800",
"ApiName" : "测试API名称",
"TenantId" : 10001,
"ApiPath" : "/test/1",
"Protocols" : 0,
"RegistrationDetails" : {
"ServiceHost" : "http://www.abc.com",
"ServiceContentType" : 0,
"ServicePath" : "/index",
"SuccessfulResultSample" : "{\"success\": true}",
"FailedResultSample" : "{\"success\": false}",
"ServiceRequestBodyDescription" : "{\"abc\":1}",
"RegistrationErrorCodes" : {
"ErrorMessage" : "The connection does not exist.",
"ErrorCode" : "Invalid.Tenant.ConnectionNotExists",
"ErrorSolution" : "retry"
},
"RegistrationRequestParameters" : {
"ParameterName" : "name1",
"ParameterPosition" : 0,
"ParameterDescription" : "description1",
"DefaultValue" : "default1",
"ParameterOperator" : 0,
"ExampleValue" : "example1",
"ParameterDataType" : 0,
"IsRequiredParameter" : true
}
},
"ScriptDetails" : {
"IsPagedResponse" : true,
"SuccessfulResultSample" : "{\"success\": true}",
"FailedResultSample" : "{\"success\": false}",
"Script" : "select a from t",
"ScriptErrorCodes" : {
"ErrorMessage" : "fail to call",
"ErrorCode" : 1001,
"ErrorSolution" : "retry"
},
"ScriptRequestParameters" : {
"ParameterName" : "param1",
"ParameterPosition" : 0,
"ParameterDescription" : "description1",
"DefaultValue" : "default1",
"ParameterOperator" : 0,
"ExampleValue" : "example1",
"ParameterDataType" : 0,
"IsRequiredParameter" : true
},
"ScriptResponseParameters" : {
"ParameterDescription" : "description2",
"ParameterName" : "param2",
"ExampleValue" : "example2",
"ParameterDataType" : 0
},
"ScriptConnection" : {
"TableName" : "t",
"ConnectionId" : 123
}
},
"WizardDetails" : {
"IsPagedResponse" : true,
"SuccessfulResultSample" : "{\"success\": true}",
"FailedResultSample" : "{\"success\": false}",
"WizardErrorCodes" : {
"ErrorMessage" : "fail to call",
"ErrorCode" : 1001,
"ErrorSolution" : "retry"
},
"WizardRequestParameters" : {
"ParameterName" : "param1",
"ParameterPosition" : 0,
"ParameterDescription" : "description1",
"DefaultValue" : "default1",
"ParameterOperator" : 0,
"ExampleValue" : "example1",
"ParameterDataType" : 0,
"IsRequiredParameter" : true
},
"WizardResponseParameters" : {
"ParameterDescription" : "description2",
"ParameterName" : "param2",
"ExampleValue" : "example2",
"ParameterDataType" : 0
},
"WizardConnection" : {
"TableName" : "t",
"ConnectionId" : 123
}
}
}
}
错误码
HttpCode |
错误码 |
错误信息 |
描述 |
429 | Throttling.Api | The request for this resource has exceeded your available limit. | 对该资源的请求已超过您的可用上限。 |
429 | Throttling.System | The DataWorks system is busy. Try again later. | DataWorks系统繁忙,请稍后再试。 |
429 | Throttling.User | Your request is too frequent. Try again later. | 您的请求过于频繁,请尝试放缓请求速度。 |
500 | InternalError.System | An internal system error occurred. Try again later. | 系统内部错误,请稍后再试。 |
500 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | 系统内部错误,请稍后再试。 |
访问错误中心查看更多错误码。
内容没看懂? 不太想学习?想快速解决? 有偿解决: 联系专家
阿里云企业补贴进行中: 马上申请
腾讯云限时活动1折起,即将结束: 马上收藏
同尘科技为腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利:同意关联,立享优惠
转转请注明出处:https://www.yunxiaoer.com/171199.html