Deletes an entire resource tree. This operation will delete the parent resource and its child resources.
Child resources are resources that were created from another resource. For example, when a forecast is generated from a predictor, the forecast is the child resource and the predictor is the parent resource.
Amazon Forecast resources possess the following parent-child resource hierarchies:
-
Dataset: dataset import jobs
-
Dataset Group: predictors, predictor backtest export jobs, forecasts, forecast export jobs
-
Predictor: predictor backtest export jobs, forecasts, forecast export jobs
-
Forecast: forecast export jobs
DeleteResourceTree will only delete Amazon Forecast resources, and will not delete datasets or exported files stored in Amazon S3.
Parameters:
-
resource_arn
(Arn)
–
The Amazon Resource Name (ARN) of the parent resource to delete. All child resources of the parent resource will also be deleted.
Raises:
Source code in docs_src/capo_forecast/_services/forecast.py
| def delete_resource_tree(
self,
resource_arn: "capo_forecast.types.arn.Arn",
*,
config_overrides: Optional[forecastClientConfig] = None,
) -> None:
"""<p>Deletes an entire resource tree. This operation will delete the parent resource and its child resources.</p> <p>Child resources are resources that were created from another resource. For example, when a forecast is generated from a predictor, the forecast is the child resource and the predictor is the parent resource.</p> <p>Amazon Forecast resources possess the following parent-child resource hierarchies:</p> <ul> <li> <p> <b>Dataset</b>: dataset import jobs</p> </li> <li> <p> <b>Dataset Group</b>: predictors, predictor backtest export jobs, forecasts, forecast export jobs</p> </li> <li> <p> <b>Predictor</b>: predictor backtest export jobs, forecasts, forecast export jobs</p> </li> <li> <p> <b>Forecast</b>: forecast export jobs</p> </li> </ul> <note> <p> <code>DeleteResourceTree</code> will only delete Amazon Forecast resources, and will not delete datasets or exported files stored in Amazon S3. </p> </note>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the parent resource to delete. All child resources of the parent resource will also be deleted.</p>
Raises:
capo_forecast.errors.invalid_input_exception.InvalidInputException: <p>We can't process the request because it includes an invalid value or a value that exceeds the valid range.</p>
capo_forecast.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is in use.</p>
capo_forecast.errors.resource_not_found_exception.ResourceNotFoundException: <p>We can't find a resource with that Amazon Resource Name (ARN). Check the ARN and try again.</p>
capo_forecast.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_forecast.types.delete_resource_tree_request.DeleteResourceTreeRequest]",
) -> OperationResponse[None]:
import capo_forecast._operations.amazon_forecast.delete_resource_tree
output, http_response = (
capo_forecast._operations.amazon_forecast.delete_resource_tree.delete_resource_tree(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteResourceTree")
)
input_: capo_forecast.types.delete_resource_tree_request.DeleteResourceTreeRequest = {
"resource_arn": resource_arn
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|