Skip to content

update_workflow async

update_workflow(
    id: MigrationWorkflowId,
    *,
    config_overrides: Optional[AsyncMigrationHubOrchestratorClientConfig] = None,
    name: Optional[str] = None,
    description: Optional[str] = None,
    input_parameters: Optional[StepInputParameters] = None,
    step_targets: Optional[StringList] = None,
) -> UpdateMigrationWorkflowResponse

Update a migration workflow.

Parameters:

  • id (MigrationWorkflowId) –

    The ID of the migration workflow.

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

    The name of the migration workflow.

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

    The description of the migration workflow.

  • input_parameters (Optional[StepInputParameters], default: None ) –

    The input parameters required to update a migration workflow.

  • step_targets (Optional[StringList], default: None ) –

    The servers on which a step will be run.

Raises:

Source code in docs_src/capo_migrationhuborchestrator/_services/async_migration_hub_orchestrator.py
async def update_workflow(
    self,
    id: "capo_migrationhuborchestrator.types.migration_workflow_id.MigrationWorkflowId",
    *,
    config_overrides: Optional[AsyncMigrationHubOrchestratorClientConfig] = None,
    name: Optional[str] = None,
    description: Optional[str] = None,
    input_parameters: Optional[
        "capo_migrationhuborchestrator.types.step_input_parameters.StepInputParameters"
    ] = None,
    step_targets: Optional[
        "capo_migrationhuborchestrator.types.string_list.StringList"
    ] = None,
) -> "capo_migrationhuborchestrator.types.update_migration_workflow_response.UpdateMigrationWorkflowResponse":
    """<p>Update a migration workflow.</p>

    Args:
        id: <p>The ID of the migration workflow.</p>
        name: <p>The name of the migration workflow.</p>
        description: <p>The description of the migration workflow.</p>
        input_parameters: <p>The input parameters required to update a migration workflow.</p>
        step_targets: <p>The servers on which a step will be run.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_migrationhuborchestrator.types.update_migration_workflow_request.UpdateMigrationWorkflowRequest]",
    ) -> AsyncOperationResponse[
        "capo_migrationhuborchestrator.types.update_migration_workflow_response.UpdateMigrationWorkflowResponse"
    ]:
        import capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.update_workflow

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

    def _redact_input(
        input_: "capo_migrationhuborchestrator.types.update_migration_workflow_request.UpdateMigrationWorkflowRequest",
    ) -> dict[str, Any]:
        import capo_migrationhuborchestrator.types.update_migration_workflow_request

        return capo_migrationhuborchestrator.types.update_migration_workflow_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_migrationhuborchestrator.types.update_migration_workflow_response.UpdateMigrationWorkflowResponse",
    ) -> dict[str, Any]:
        import capo_migrationhuborchestrator.types.update_migration_workflow_response

        return capo_migrationhuborchestrator.types.update_migration_workflow_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateWorkflow",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_migrationhuborchestrator.types.update_migration_workflow_request.UpdateMigrationWorkflowRequest = {
        "id": id
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if input_parameters is not None:
        input_["input_parameters"] = input_parameters
    if step_targets is not None:
        input_["step_targets"] = step_targets

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