Returns summaries of invoked Hooks. For more information, see View invocation summaries for CloudFormation Hooks in the CloudFormation Hooks User Guide.
This operation supports the following parameter combinations:
-
No parameters: Returns all Hook invocation summaries.
-
TypeArn only: Returns summaries for a specific Hook.
-
TypeArn and Status: Returns summaries for a specific Hook filtered by status.
-
TargetId and TargetType: Returns summaries for a specific Hook invocation target.
Parameters:
-
target_type
(Optional[ListHookResultsTargetType], default:
None
)
–
Filters results by target type. Currently, only CHANGE_SET and CLOUD_CONTROL are supported filter options.
Required when TargetId is specified and cannot be used otherwise.
-
target_id
(Optional[HookResultId], default:
None
)
–
Filters results by the unique identifier of the target the Hook was invoked against.
For change sets, this is the change set ARN. When the target is a Cloud Control API operation, this value must be the HookRequestToken returned by the Cloud Control API request. For more information on the HookRequestToken, see ProgressEvent.
Required when TargetType is specified and cannot be used otherwise.
-
type_arn
(Optional[HookTypeArn], default:
None
)
–
Filters results by the ARN of the Hook. Can be used alone or in combination with Status.
-
status
(Optional[HookStatus], default:
None
)
–
Filters results by the status of Hook invocations. Can only be used in combination with TypeArn. Valid values are:
-
HOOK_IN_PROGRESS: The Hook is currently running.
-
HOOK_COMPLETE_SUCCEEDED: The Hook completed successfully.
-
HOOK_COMPLETE_FAILED: The Hook completed but failed validation.
-
HOOK_FAILED: The Hook encountered an error during execution.
-
next_token
(Optional[NextToken], default:
None
)
–
The token for the next set of items to return. (You received this token from a previous call.)
Raises:
Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
| async def list_hook_results(
self,
*,
config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
target_type: Optional[
"capo_cloudformation.types.list_hook_results_target_type.ListHookResultsTargetType"
] = None,
target_id: Optional[
"capo_cloudformation.types.hook_result_id.HookResultId"
] = None,
type_arn: Optional[
"capo_cloudformation.types.hook_type_arn.HookTypeArn"
] = None,
status: Optional["capo_cloudformation.types.hook_status.HookStatus"] = None,
next_token: Optional["capo_cloudformation.types.next_token.NextToken"] = None,
) -> "capo_cloudformation.types.list_hook_results_output.ListHookResultsOutput":
"""<p>Returns summaries of invoked Hooks. For more information, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/hooks-userguide/hooks-view-invocations.html">View invocation summaries for CloudFormation Hooks</a> in the <i>CloudFormation Hooks User Guide</i>.</p> <p>This operation supports the following parameter combinations:</p> <ul> <li> <p>No parameters: Returns all Hook invocation summaries.</p> </li> <li> <p> <code>TypeArn</code> only: Returns summaries for a specific Hook.</p> </li> <li> <p> <code>TypeArn</code> and <code>Status</code>: Returns summaries for a specific Hook filtered by status.</p> </li> <li> <p> <code>TargetId</code> and <code>TargetType</code>: Returns summaries for a specific Hook invocation target.</p> </li> </ul>
Args:
target_type: <p>Filters results by target type. Currently, only <code>CHANGE_SET</code> and <code>CLOUD_CONTROL</code> are supported filter options.</p> <p>Required when <code>TargetId</code> is specified and cannot be used otherwise.</p>
target_id: <p>Filters results by the unique identifier of the target the Hook was invoked against.</p> <p>For change sets, this is the change set ARN. When the target is a Cloud Control API operation, this value must be the <code>HookRequestToken</code> returned by the Cloud Control API request. For more information on the <code>HookRequestToken</code>, see <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_ProgressEvent.html">ProgressEvent</a>.</p> <p>Required when <code>TargetType</code> is specified and cannot be used otherwise.</p>
type_arn: <p>Filters results by the ARN of the Hook. Can be used alone or in combination with <code>Status</code>.</p>
status: <p>Filters results by the status of Hook invocations. Can only be used in combination with <code>TypeArn</code>. Valid values are:</p> <ul> <li> <p> <code>HOOK_IN_PROGRESS</code>: The Hook is currently running.</p> </li> <li> <p> <code>HOOK_COMPLETE_SUCCEEDED</code>: The Hook completed successfully.</p> </li> <li> <p> <code>HOOK_COMPLETE_FAILED</code>: The Hook completed but failed validation.</p> </li> <li> <p> <code>HOOK_FAILED</code>: The Hook encountered an error during execution.</p> </li> </ul>
next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
Raises:
capo_cloudformation.errors.hook_result_not_found_exception.HookResultNotFoundException: <p>The specified target doesn't have any requested Hook invocations.</p>
capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudformation.types.list_hook_results_input.ListHookResultsInput]",
) -> AsyncOperationResponse[
"capo_cloudformation.types.list_hook_results_output.ListHookResultsOutput"
]:
import capo_cloudformation._operations.cloud_formation.list_hook_results
(
output,
http_response,
) = await capo_cloudformation._operations.cloud_formation.list_hook_results.async_list_hook_results(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListHookResults")
)
input_: capo_cloudformation.types.list_hook_results_input.ListHookResultsInput = {}
if target_type is not None:
input_["target_type"] = target_type
if target_id is not None:
input_["target_id"] = target_id
if type_arn is not None:
input_["type_arn"] = type_arn
if status is not None:
input_["status"] = status
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|