Skip to content

create_workflow async

create_workflow(
    name: str,
    template_id: str,
    input_parameters: StepInputParameters,
    *,
    config_overrides: Optional[AsyncMigrationHubOrchestratorClientConfig] = None,
    description: Optional[str] = None,
    application_configuration_id: Optional[str] = None,
    step_targets: Optional[StringList] = None,
    tags: Optional[StringMap] = None,
) -> CreateMigrationWorkflowResponse

Create a workflow to orchestrate your migrations.

Parameters:

  • name (str) –

    The name of the migration workflow.

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

    The description of the migration workflow.

  • template_id (str) –

    The ID of the template.

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

    The configuration ID of the application configured in Application Discovery Service.

  • input_parameters (StepInputParameters) –

    The input parameters required to create a migration workflow.

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

    The servers on which a step will be run.

  • tags (Optional[StringMap], default: None ) –

    The tags to add on a migration workflow.

Raises:

Source code in docs_src/capo_migrationhuborchestrator/_services/async_migration_hub_orchestrator.py
async def create_workflow(
    self,
    name: str,
    template_id: str,
    input_parameters: "capo_migrationhuborchestrator.types.step_input_parameters.StepInputParameters",
    *,
    config_overrides: Optional[AsyncMigrationHubOrchestratorClientConfig] = None,
    description: Optional[str] = None,
    application_configuration_id: Optional[str] = None,
    step_targets: Optional[
        "capo_migrationhuborchestrator.types.string_list.StringList"
    ] = None,
    tags: Optional[
        "capo_migrationhuborchestrator.types.string_map.StringMap"
    ] = None,
) -> "capo_migrationhuborchestrator.types.create_migration_workflow_response.CreateMigrationWorkflowResponse":
    """<p>Create a workflow to orchestrate your migrations.</p>

    Args:
        name: <p>The name of the migration workflow.</p>
        description: <p>The description of the migration workflow.</p>
        template_id: <p>The ID of the template.</p>
        application_configuration_id: <p>The configuration ID of the application configured in Application Discovery Service.</p>
        input_parameters: <p>The input parameters required to create a migration workflow.</p>
        step_targets: <p>The servers on which a step will be run.</p>
        tags: <p>The tags to add on a migration workflow.</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.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.create_migration_workflow_request.CreateMigrationWorkflowRequest]",
    ) -> AsyncOperationResponse[
        "capo_migrationhuborchestrator.types.create_migration_workflow_response.CreateMigrationWorkflowResponse"
    ]:
        import capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.create_workflow

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

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

        return capo_migrationhuborchestrator.types.create_migration_workflow_request.redact_sensitive(
            input_
        )

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

        return capo_migrationhuborchestrator.types.create_migration_workflow_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateWorkflow",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_migrationhuborchestrator.types.create_migration_workflow_request.CreateMigrationWorkflowRequest = {
        "name": name,
        "template_id": template_id,
        "input_parameters": input_parameters,
    }
    if description is not None:
        input_["description"] = description
    if application_configuration_id is not None:
        input_["application_configuration_id"] = application_configuration_id
    if step_targets is not None:
        input_["step_targets"] = step_targets
    if tags is not None:
        input_["tags"] = tags

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