Skip to content

list_pentest_jobs_for_pentest

list_pentest_jobs_for_pentest(
    pentest_id: str,
    agent_space_id: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    job_type: Optional[JobType] = None,
) -> ListPentestJobsForPentestOutput

Returns a paginated list of pentest job summaries for the specified pentest configuration.

Parameters:

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return in a single call.

  • pentest_id (str) –

    The unique identifier of the pentest to list jobs for.

  • agent_space_id (str) –

    The unique identifier of the agent space.

  • next_token (Optional[NextToken], default: None ) –

    A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request.

  • job_type (Optional[JobType], default: None ) –

    Filters the returned pentest jobs to only those of the specified job type.

Raises:

Source code in docs_src/capo_securityagent/_services/security_agent.py
def list_pentest_jobs_for_pentest(
    self,
    pentest_id: str,
    agent_space_id: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
    max_results: Optional["capo_securityagent.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_securityagent.types.next_token.NextToken"] = None,
    job_type: Optional["capo_securityagent.types.job_type.JobType"] = None,
) -> "capo_securityagent.types.list_pentest_jobs_for_pentest_output.ListPentestJobsForPentestOutput":
    """<p>Returns a paginated list of pentest job summaries for the specified pentest configuration.</p>

    Args:
        max_results: <p>The maximum number of results to return in a single call.</p>
        pentest_id: <p>The unique identifier of the pentest to list jobs for.</p>
        agent_space_id: <p>The unique identifier of the agent space.</p>
        next_token: <p>A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request.</p>
        job_type: <p>Filters the returned pentest jobs to only those of the specified job type.</p>

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

    def _handler(
        req: "OperationRequest[capo_securityagent.types.list_pentest_jobs_for_pentest_input.ListPentestJobsForPentestInput]",
    ) -> OperationResponse[
        "capo_securityagent.types.list_pentest_jobs_for_pentest_output.ListPentestJobsForPentestOutput"
    ]:
        import capo_securityagent._operations.security_agent.list_pentest_jobs_for_pentest

        output, http_response = (
            capo_securityagent._operations.security_agent.list_pentest_jobs_for_pentest.list_pentest_jobs_for_pentest(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPentestJobsForPentest")
    )
    input_: capo_securityagent.types.list_pentest_jobs_for_pentest_input.ListPentestJobsForPentestInput = {
        "pentest_id": pentest_id,
        "agent_space_id": agent_space_id,
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if job_type is not None:
        input_["job_type"] = job_type

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