Skip to content

list_discovered_endpoints

list_discovered_endpoints(
    pentest_job_id: str,
    agent_space_id: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    prefix: Optional[str] = None,
    next_token: Optional[NextToken] = None,
) -> ListDiscoveredEndpointsOutput

Returns a paginated list of endpoints discovered during a pentest job execution.

Parameters:

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

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

  • pentest_job_id (str) –

    The unique identifier of the pentest job to list discovered endpoints for.

  • agent_space_id (str) –

    The unique identifier of the agent space.

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

    A prefix to filter discovered endpoints by URI.

  • 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.

Raises:

Source code in docs_src/capo_securityagent/_services/security_agent.py
def list_discovered_endpoints(
    self,
    pentest_job_id: str,
    agent_space_id: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
    max_results: Optional["capo_securityagent.types.max_results.MaxResults"] = None,
    prefix: Optional[str] = None,
    next_token: Optional["capo_securityagent.types.next_token.NextToken"] = None,
) -> "capo_securityagent.types.list_discovered_endpoints_output.ListDiscoveredEndpointsOutput":
    """<p>Returns a paginated list of endpoints discovered during a pentest job execution.</p>

    Args:
        max_results: <p>The maximum number of results to return in a single call.</p>
        pentest_job_id: <p>The unique identifier of the pentest job to list discovered endpoints for.</p>
        agent_space_id: <p>The unique identifier of the agent space.</p>
        prefix: <p>A prefix to filter discovered endpoints by URI.</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>

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

    def _handler(
        req: "OperationRequest[capo_securityagent.types.list_discovered_endpoints_input.ListDiscoveredEndpointsInput]",
    ) -> OperationResponse[
        "capo_securityagent.types.list_discovered_endpoints_output.ListDiscoveredEndpointsOutput"
    ]:
        import capo_securityagent._operations.security_agent.list_discovered_endpoints

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDiscoveredEndpoints")
    )
    input_: capo_securityagent.types.list_discovered_endpoints_input.ListDiscoveredEndpointsInput = {
        "pentest_job_id": pentest_job_id,
        "agent_space_id": agent_space_id,
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if prefix is not None:
        input_["prefix"] = prefix
    if next_token is not None:
        input_["next_token"] = next_token

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