Deletes a file from DataStudio. If the file has been committed, an asynchronous process is triggered to delete the file in the scheduling system. The value of the DeploymentId parameter returned is used to call the GetDeployment operation to poll the status of the asynchronous process.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DeleteFile |
The operation that you want to perform. |
ProjectId | Long | No | 10000 |
The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to view the workspace ID. You must specify one of the ProjectId and ProjectIdentifier parameters to determine the DataWorks workspace to which the operation is applied. |
RegionId | String | Yes | cn-zhangjiakou |
The ID of the region in which the DataWorks workspace resides. For example, the ID of the China (Shanghai) region is cn-shanghai, and the ID of the China (Zhangjiakou) region is cn-zhangjiakou. The system automatically determines the value of this parameter based on the endpoint that is used to call the operation. |
ProjectIdentifier | String | No | dw_project |
The name of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to view the workspace name. You must specify one of the ProjectId and ProjectIdentifier parameters to determine the DataWorks workspace to which the operation is applied. |
FileId | Long | Yes | 10000001 |
The ID of the file. You can call the ListFiles operation to query the ID of the file. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
HttpStatusCode | Integer | 200 |
The HTTP status code. |
DeploymentId | Long | 1000000001 |
The ID of the deployment task that deploys the file. If the file has been committed, an asynchronous process is triggered to delete the file in the scheduling system. The value of this parameter is used to call the GetDeployment operation to poll the status of the asynchronous process. If this parameter is empty, the file is deleted and the polling is not required. |
RequestId | String | 0000-ABCD-EFG**** |
The ID of the request. You can troubleshoot errors based on the ID. |
ErrorMessage | String | The connection does not exist. |
The error message returned. |
Success | Boolean | true |
Indicates whether the request is successful. Valid values:
|
ErrorCode | String | Invalid.Tenant.ConnectionNotExists |
The error code returned. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=DeleteFile
&ProjectId=10000
&ProjectIdentifier=dw_project
&FileId=10000001
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DeleteFileResponse>
<HttpStatusCode>200</HttpStatusCode>
<DeploymentId>1000000001</DeploymentId>
<RequestId>0000-ABCD-EFG****</RequestId>
<ErrorMessage>The connection does not exist.</ErrorMessage>
<Success>true</Success>
<ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
</DeleteFileResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"HttpStatusCode" : 200,
"DeploymentId" : 1000000001,
"RequestId" : "0000-ABCD-EFG****",
"ErrorMessage" : "The connection does not exist.",
"Success" : true,
"ErrorCode" : "Invalid.Tenant.ConnectionNotExists"
}
Error codes
Http status code | Error code | Error message | Description |
---|---|---|---|
500 | InternalError.System | An internal system error occurred. Try again later. | The error message returned because an internal error has occurred. Try again later. |
500 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | The error message returned because an internal error has occurred. Try again later. |
403 | Forbidden.Access | Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. | The error message returned because you are not allowed to perform this operation. Activate DataWorks Enterprise Edition or Ultimate Edition. |
429 | Throttling.Api | The request for this resource has exceeded your available limit. | The error message returned because the number of requests for the resource has exceeded the upper limit. |
429 | Throttling.System | The DataWorks system is busy. Try again later. | The error message returned because the DataWorks system is busy. Try again later. |
429 | Throttling.User | Your request is too frequent. Try again later. | The error message returned because excessive requests have been submitted within a short period of time. Try again later. |
For a list of error codes, visit the API Error Center.