Skip to content

start_test

start_test(
    source_server_i_ds: StartTestRequestSourceServerIDs,
    *,
    config_overrides: Optional[mgnClientConfig] = None,
    tags: Optional[TagsMap] = None,
    account_id: Optional[AccountID] = None,
) -> StartTestResponse

Launches a Test Instance for specific Source Servers. This command starts a LAUNCH job whose initiatedBy property is StartTest and changes the SourceServer.lifeCycle.state property to TESTING.

Parameters:

Raises:

Source code in docs_src/capo_mgn/_services/mgn.py
def start_test(
    self,
    source_server_i_ds: "capo_mgn.types.start_test_request_source_server_i_ds.StartTestRequestSourceServerIDs",
    *,
    config_overrides: Optional[mgnClientConfig] = None,
    tags: Optional["capo_mgn.types.tags_map.TagsMap"] = None,
    account_id: Optional["capo_mgn.types.account_id.AccountID"] = None,
) -> "capo_mgn.types.start_test_response.StartTestResponse":
    """<p>Launches a Test Instance for specific Source Servers. This command starts a LAUNCH job whose initiatedBy property is StartTest and changes the SourceServer.lifeCycle.state property to TESTING.</p>

    Args:
        source_server_i_ds: <p>Start Test for Source Server IDs.</p>
        tags: <p>Start Test by Tags.</p>
        account_id: <p>Start Test for Account ID.</p>

    Raises:
        capo_mgn.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the target resource.</p>
        capo_mgn.errors.uninitialized_account_exception.UninitializedAccountException: <p>Uninitialized account exception.</p>
        capo_mgn.errors.validation_exception.ValidationException: <p>Validate exception.</p>
        capo_mgn.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mgn.types.start_test_request.StartTestRequest]",
    ) -> OperationResponse["capo_mgn.types.start_test_response.StartTestResponse"]:
        import capo_mgn._operations.application_migration_service.start_test

        output, http_response = (
            capo_mgn._operations.application_migration_service.start_test.start_test(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_mgn.types.start_test_request.StartTestRequest",
    ) -> dict[str, Any]:
        import capo_mgn.types.start_test_request

        return capo_mgn.types.start_test_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_mgn.types.start_test_response.StartTestResponse",
    ) -> dict[str, Any]:
        import capo_mgn.types.start_test_response

        return capo_mgn.types.start_test_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartTest", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_mgn.types.start_test_request.StartTestRequest = {
        "source_server_i_ds": source_server_i_ds
    }
    if tags is not None:
        input_["tags"] = tags
    if account_id is not None:
        input_["account_id"] = account_id

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