List the templates available in Migration Hub Orchestrator to create a migration workflow.
Parameters:
Raises:
Source code in docs_src/capo_migrationhuborchestrator/_services/migration_hub_orchestrator.py
| def list_templates(
self,
*,
config_overrides: Optional[MigrationHubOrchestratorClientConfig] = None,
max_results: Optional[
"capo_migrationhuborchestrator.types.max_results.MaxResults"
] = None,
next_token: Optional[
"capo_migrationhuborchestrator.types.next_token.NextToken"
] = None,
name: Optional[
"capo_migrationhuborchestrator.types.template_name.TemplateName"
] = None,
) -> "capo_migrationhuborchestrator.types.list_migration_workflow_templates_response.ListMigrationWorkflowTemplatesResponse":
"""<p>List the templates available in Migration Hub Orchestrator to create a migration workflow.</p>
Args:
max_results: <p>The maximum number of results that can be returned.</p>
next_token: <p>The pagination token.</p>
name: <p>The name of the template.</p>
Raises:
capo_migrationhuborchestrator.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_migrationhuborchestrator.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred.</p>
capo_migrationhuborchestrator.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_migrationhuborchestrator.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_migrationhuborchestrator.types.list_migration_workflow_templates_request.ListMigrationWorkflowTemplatesRequest]",
) -> OperationResponse[
"capo_migrationhuborchestrator.types.list_migration_workflow_templates_response.ListMigrationWorkflowTemplatesResponse"
]:
import capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.list_templates
output, http_response = (
capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.list_templates.list_templates(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListTemplates")
)
input_: capo_migrationhuborchestrator.types.list_migration_workflow_templates_request.ListMigrationWorkflowTemplatesRequest = {}
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
if name is not None:
input_["name"] = name
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|