Skip to content

update_template

update_template(
    id: TemplateId,
    *,
    config_overrides: Optional[MigrationHubOrchestratorClientConfig] = None,
    template_name: Optional[str] = None,
    template_description: Optional[str] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdateTemplateResponse

Updates a migration workflow template.

Parameters:

  • id (TemplateId) –

    The ID of the request to update a migration workflow template.

  • template_name (Optional[str], default: None ) –

    The name of the migration workflow template to update.

  • template_description (Optional[str], default: None ) –

    The description of the migration workflow template to update.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_migrationhuborchestrator/_services/migration_hub_orchestrator.py
def update_template(
    self,
    id: "capo_migrationhuborchestrator.types.template_id.TemplateId",
    *,
    config_overrides: Optional[MigrationHubOrchestratorClientConfig] = None,
    template_name: Optional[str] = None,
    template_description: Optional[str] = None,
    client_token: Optional[
        "capo_migrationhuborchestrator.types.client_token.ClientToken"
    ] = None,
) -> "capo_migrationhuborchestrator.types.update_template_response.UpdateTemplateResponse":
    """<p>Updates a migration workflow template.</p>

    Args:
        id: <p>The ID of the request to update a migration workflow template.</p>
        template_name: <p>The name of the migration workflow template to update.</p>
        template_description: <p>The description of the migration workflow template to update.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</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.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_migrationhuborchestrator.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_migrationhuborchestrator.types.update_template_request.UpdateTemplateRequest]",
    ) -> OperationResponse[
        "capo_migrationhuborchestrator.types.update_template_response.UpdateTemplateResponse"
    ]:
        import capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.update_template

        output, http_response = (
            capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.update_template.update_template(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTemplate")
    )
    input_: capo_migrationhuborchestrator.types.update_template_request.UpdateTemplateRequest = {
        "id": id
    }
    if template_name is not None:
        input_["template_name"] = template_name
    if template_description is not None:
        input_["template_description"] = template_description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output