Skip to content

describe_agents

describe_agents(
    *,
    config_overrides: Optional[ApplicationDiscoveryServiceClientConfig] = None,
    agent_ids: Optional[AgentIds] = None,
    filters: Optional[Filters] = None,
    max_results: Optional[Integer] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeAgentsResponse

Lists agents or collectors as specified by ID or other filters. All agents/collectors associated with your user can be listed if you call DescribeAgents as is without passing any parameters.

Parameters:

  • agent_ids (Optional[AgentIds], default: None ) –

    The agent or the collector IDs for which you want information. If you specify no IDs, the system returns information about all agents/collectors associated with your user.

  • filters (Optional[Filters], default: None ) –

    You can filter the request using various logical operators and a key-value format. For example:

    {"key": "collectionStatus", "value": "STARTED"}

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

    The total number of agents/collectors to return in a single page of output. The maximum value is 100.

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

    Token to retrieve the next set of results. For example, if you previously specified 100 IDs for DescribeAgentsRequest$agentIds but set DescribeAgentsRequest$maxResults to 10, you received a set of 10 results along with a token. Use that token in this query to get the next set of 10.

Raises:

Source code in docs_src/capo_application_discovery_service/_services/application_discovery_service.py
def describe_agents(
    self,
    *,
    config_overrides: Optional[ApplicationDiscoveryServiceClientConfig] = None,
    agent_ids: Optional[
        "capo_application_discovery_service.types.agent_ids.AgentIds"
    ] = None,
    filters: Optional[
        "capo_application_discovery_service.types.filters.Filters"
    ] = None,
    max_results: Optional[
        "capo_application_discovery_service.types.integer.Integer"
    ] = None,
    next_token: Optional[
        "capo_application_discovery_service.types.next_token.NextToken"
    ] = None,
) -> "capo_application_discovery_service.types.describe_agents_response.DescribeAgentsResponse":
    """<p>Lists agents or collectors as specified by ID or other filters. All agents/collectors associated with your user can be listed if you call <code>DescribeAgents</code> as is without passing any parameters.</p>

    Args:
        agent_ids: <p>The agent or the collector IDs for which you want information. If you specify no IDs, the system returns information about all agents/collectors associated with your user.</p>
        filters: <p>You can filter the request using various logical operators and a <i>key</i>-<i>value</i> format. For example: </p> <p> <code>{"key": "collectionStatus", "value": "STARTED"}</code> </p>
        max_results: <p>The total number of agents/collectors to return in a single page of output. The maximum value is 100.</p>
        next_token: <p>Token to retrieve the next set of results. For example, if you previously specified 100 IDs for <code>DescribeAgentsRequest$agentIds</code> but set <code>DescribeAgentsRequest$maxResults</code> to 10, you received a set of 10 results along with a token. Use that token in this query to get the next set of 10.</p>

    Raises:
        capo_application_discovery_service.errors.authorization_error_exception.AuthorizationErrorException: <p>The user does not have permission to perform the action. Check the IAM policy associated with this user.</p>
        capo_application_discovery_service.errors.home_region_not_set_exception.HomeRegionNotSetException: <p>The home Region is not set. Set the home Region to continue.</p>
        capo_application_discovery_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid. Verify the parameters and try again.</p>
        capo_application_discovery_service.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value of one or more parameters are either invalid or out of range. Verify the parameter values and try again.</p>
        capo_application_discovery_service.errors.server_internal_error_exception.ServerInternalErrorException: <p>The server experienced an internal error. Try again.</p>
        capo_application_discovery_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_application_discovery_service.types.describe_agents_request.DescribeAgentsRequest]",
    ) -> OperationResponse[
        "capo_application_discovery_service.types.describe_agents_response.DescribeAgentsResponse"
    ]:
        import capo_application_discovery_service._operations.aws_poseidon_service_v2015_11_01.describe_agents

        output, http_response = (
            capo_application_discovery_service._operations.aws_poseidon_service_v2015_11_01.describe_agents.describe_agents(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_application_discovery_service.types.describe_agents_response.DescribeAgentsResponse",
    ) -> dict[str, Any]:
        import capo_application_discovery_service.types.describe_agents_response

        return capo_application_discovery_service.types.describe_agents_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeAgents", redact_output=_redact_output),
    )
    input_: capo_application_discovery_service.types.describe_agents_request.DescribeAgentsRequest = {}
    if agent_ids is not None:
        input_["agent_ids"] = agent_ids
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    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