該介面用於建立DataWorks資料來源。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ProjectId |
integer |
是 |
資料來源所在的 DataWorks 工作空間 ID。您可以通過 ListProjects 介面擷取工作空間 ID。 |
1 |
| Name |
string |
是 |
資料來源的名稱。 |
abc |
| Description |
string |
否 |
資料來源的描述資訊。 |
abc |
| DataSourceType |
string |
是 |
資料來源的類型。常用類型如下:
|
rds |
| SubType |
string |
否 |
資料來源的子類型。使用如下:
|
mysql |
| EnvType |
integer |
是 |
資料來源所屬的環境,包括 0(開發環境)和 1(生產環境)。 |
1 |
| Content |
string |
是 |
資料來源的詳細資料。部分常用資料來源範例如下:
|
{"database":"dbname","instanceName":"instancename","password":"password","rdsOwnerId":"123","username":"username"} |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回結果。 |
||
| HttpStatusCode |
string |
請求返回碼。 |
200 |
| Data |
integer |
資料來源 ID。 |
123 |
| RequestId |
string |
請求 ID。 |
0bc141151593763**** |
| Success |
boolean |
請求是否成功。 |
true |
樣本
正常返回樣本
JSON格式
{
"HttpStatusCode": "200",
"Data": 123,
"RequestId": "0bc141151593763****",
"Success": true
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | Invalid.Tenant.ConnectionNotExists | The connection does not exist. | 資料來源不存在。 |
| 400 | Invalid.Tenant.ProjectNotExists | The project does not exist. | 專案不存在。 |
| 400 | Invalid.Tenant.UserNotInProject | The user is not in the project. | 使用者不在專案中。 |
| 400 | ConnectionAlreadyExist | The connection with envType %s and name %s already exists. | 串連串名稱重複 |
| 400 | DataSource.CheckRamRoleFailure | Failed to check the RAM role. AccountId %s. roleArn %s. | 校正資料來源許可權失敗 |
| 400 | DataSource.ConnectionStrProperty.PatternNotMatch | The pattern value %s is invalid. The correct pattern is %s. | 資料來源串連串屬性不匹配規則 |
| 400 | Invalid.DataSource.DataSourceTypeNotSupport | The dataSourceType %s and subType %s are not supported. | 資料來源類型暫不支援 |
| 400 | Invalid.Param.Odps.EngineIdOrConnectStrEmpty | Either the compute engine ID or the connection string must be specified when data source type is ODPS. | |
| 400 | MissingParam.ConnectionStr.Property | You must specify property %s required by the data source connection string. | 資料來源串連串資訊必填屬性缺失 |
| 400 | Invalid.DataSource.DataSourceTypeNotExist | The data source type %s does not exist. | 資料來源類型不存在。 |
| 403 | Invalid.Tenant.UserIsNotProjectOwnerOrAdmin | The user is not a project administrator or owner. | 使用者不是專案負責人或者專案系統管理員。 |
| 403 | Invalid.Tenant.UserNotInTenant | The user is not in tenant. | 使用者不在租戶中。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。