Skip to content

resume_pentest_job async

resume_pentest_job(
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    agent_space_id: Optional[str] = None,
    pentest_job_id: Optional[str] = None,
    actors: Optional[ActorList] = None,
    network_traffic_config: Optional[NetworkTrafficConfig] = None,
    vpc_config: Optional[VpcConfig] = None,
    max_task_hours: Optional[float] = None,
    copy_config_from_pentest: Optional[bool] = None,
) -> ResumePentestJobOutput

Resumes a stopped or paused pentest job from its last saved checkpoint. The job keeps its pentest job identifier and continues as a new version, keeping the findings and progress from earlier runs. You can resume a job within 7 days of when it was created.

Parameters:

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

    The unique identifier of the agent space.

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

    The unique identifier of the pentest job to resume.

  • actors (Optional[ActorList], default: None ) –

    The actors to use for the resumed job. When specified, replaces the actors the job used before it stopped.

  • network_traffic_config (Optional[NetworkTrafficConfig], default: None ) –

    The network traffic configuration to use for the resumed job. When specified, replaces the configuration the job used before it stopped.

  • vpc_config (Optional[VpcConfig], default: None ) –

    The VPC configuration to use for the resumed job. When specified, replaces the configuration the job used before it stopped.

  • max_task_hours (Optional[float], default: None ) –

    The maximum number of task hours for the resumed job. To resume a job that stopped because it reached its task hours limit, specify a higher value.

  • copy_config_from_pentest (Optional[bool], default: None ) –

    Specifies whether to copy the current actors, network traffic configuration, VPC configuration, and maximum task hours from the pentest to the resumed job. The job's scope, such as its target endpoints, is never changed. Values you specify in this request take precedence over copied values.

Raises:

Source code in docs_src/capo_securityagent/_services/async_security_agent.py
async def resume_pentest_job(
    self,
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    agent_space_id: Optional[str] = None,
    pentest_job_id: Optional[str] = None,
    actors: Optional["capo_securityagent.types.actor_list.ActorList"] = None,
    network_traffic_config: Optional[
        "capo_securityagent.types.network_traffic_config.NetworkTrafficConfig"
    ] = None,
    vpc_config: Optional["capo_securityagent.types.vpc_config.VpcConfig"] = None,
    max_task_hours: Optional[float] = None,
    copy_config_from_pentest: Optional[bool] = None,
) -> "capo_securityagent.types.resume_pentest_job_output.ResumePentestJobOutput":
    """<p>Resumes a stopped or paused pentest job from its last saved checkpoint. The job keeps its pentest job identifier and continues as a new version, keeping the findings and progress from earlier runs. You can resume a job within 7 days of when it was created.</p>

    Args:
        agent_space_id: <p>The unique identifier of the agent space.</p>
        pentest_job_id: <p>The unique identifier of the pentest job to resume.</p>
        actors: <p>The actors to use for the resumed job. When specified, replaces the actors the job used before it stopped.</p>
        network_traffic_config: <p>The network traffic configuration to use for the resumed job. When specified, replaces the configuration the job used before it stopped.</p>
        vpc_config: <p>The VPC configuration to use for the resumed job. When specified, replaces the configuration the job used before it stopped.</p>
        max_task_hours: <p>The maximum number of task hours for the resumed job. To resume a job that stopped because it reached its task hours limit, specify a higher value.</p>
        copy_config_from_pentest: <p>Specifies whether to copy the current actors, network traffic configuration, VPC configuration, and maximum task hours from the pentest to the resumed job. The job's scope, such as its target endpoints, is never changed. Values you specify in this request take precedence over copied values.</p>

    Raises:
        capo_securityagent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityagent.types.resume_pentest_job_input.ResumePentestJobInput]",
    ) -> AsyncOperationResponse[
        "capo_securityagent.types.resume_pentest_job_output.ResumePentestJobOutput"
    ]:
        import capo_securityagent._operations.security_agent.resume_pentest_job

        (
            output,
            http_response,
        ) = await capo_securityagent._operations.security_agent.resume_pentest_job.async_resume_pentest_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_securityagent.types.resume_pentest_job_input.ResumePentestJobInput",
    ) -> dict[str, Any]:
        import capo_securityagent.types.resume_pentest_job_input

        return capo_securityagent.types.resume_pentest_job_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ResumePentestJob", redact_input=_redact_input),
    )
    input_: capo_securityagent.types.resume_pentest_job_input.ResumePentestJobInput = {}
    if agent_space_id is not None:
        input_["agent_space_id"] = agent_space_id
    if pentest_job_id is not None:
        input_["pentest_job_id"] = pentest_job_id
    if actors is not None:
        input_["actors"] = actors
    if network_traffic_config is not None:
        input_["network_traffic_config"] = network_traffic_config
    if vpc_config is not None:
        input_["vpc_config"] = vpc_config
    if max_task_hours is not None:
        input_["max_task_hours"] = max_task_hours
    if copy_config_from_pentest is not None:
        input_["copy_config_from_pentest"] = copy_config_from_pentest

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