Skip to content

get_template async

get_template(
    id: TemplateId,
    *,
    config_overrides: Optional[AsyncMigrationHubOrchestratorClientConfig] = None,
) -> GetMigrationWorkflowTemplateResponse

Get the template you want to use for creating a migration workflow.

Parameters:

Raises:

Source code in docs_src/capo_migrationhuborchestrator/_services/async_migration_hub_orchestrator.py
async def get_template(
    self,
    id: "capo_migrationhuborchestrator.types.template_id.TemplateId",
    *,
    config_overrides: Optional[AsyncMigrationHubOrchestratorClientConfig] = None,
) -> "capo_migrationhuborchestrator.types.get_migration_workflow_template_response.GetMigrationWorkflowTemplateResponse":
    """<p>Get the template you want to use for creating a migration workflow.</p>

    Args:
        id: <p>The ID 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.resource_not_found_exception.ResourceNotFoundException: <p>The resource is not available.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_migrationhuborchestrator.types.get_migration_workflow_template_request.GetMigrationWorkflowTemplateRequest]",
    ) -> AsyncOperationResponse[
        "capo_migrationhuborchestrator.types.get_migration_workflow_template_response.GetMigrationWorkflowTemplateResponse"
    ]:
        import capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.get_template

        (
            output,
            http_response,
        ) = await capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.get_template.async_get_template(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetTemplate")
    )
    input_: capo_migrationhuborchestrator.types.get_migration_workflow_template_request.GetMigrationWorkflowTemplateRequest = {
        "id": id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output