Skip to content

list_server_neighbors async

list_server_neighbors(
    configuration_id: ConfigurationId,
    *,
    config_overrides: Optional[AsyncApplicationDiscoveryServiceClientConfig] = None,
    port_information_needed: Optional[Boolean] = None,
    neighbor_configuration_ids: Optional[ConfigurationIdList] = None,
    max_results: Optional[Integer] = None,
    next_token: Optional[String] = None,
) -> ListServerNeighborsResponse

Retrieves a list of servers that are one network hop away from a specified server.

Parameters:

  • configuration_id (ConfigurationId) –

    Configuration ID of the server for which neighbors are being listed.

  • port_information_needed (Optional[Boolean], default: None ) –

    Flag to indicate if port and protocol information is needed as part of the response.

  • neighbor_configuration_ids (Optional[ConfigurationIdList], default: None ) –

    List of configuration IDs to test for one-hop-away.

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

    Maximum number of results to return in a single page of output.

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

    Token to retrieve the next set of results. For example, if you previously specified 100 IDs for ListServerNeighborsRequest$neighborConfigurationIds but set ListServerNeighborsRequest$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/async_application_discovery_service.py
async def list_server_neighbors(
    self,
    configuration_id: "capo_application_discovery_service.types.configuration_id.ConfigurationId",
    *,
    config_overrides: Optional[AsyncApplicationDiscoveryServiceClientConfig] = None,
    port_information_needed: Optional[
        "capo_application_discovery_service.types.boolean.Boolean"
    ] = None,
    neighbor_configuration_ids: Optional[
        "capo_application_discovery_service.types.configuration_id_list.ConfigurationIdList"
    ] = None,
    max_results: Optional[
        "capo_application_discovery_service.types.integer.Integer"
    ] = None,
    next_token: Optional[
        "capo_application_discovery_service.types.string.String"
    ] = None,
) -> "capo_application_discovery_service.types.list_server_neighbors_response.ListServerNeighborsResponse":
    """<p>Retrieves a list of servers that are one network hop away from a specified server.</p>

    Args:
        configuration_id: <p>Configuration ID of the server for which neighbors are being listed.</p>
        port_information_needed: <p>Flag to indicate if port and protocol information is needed as part of the response.</p>
        neighbor_configuration_ids: <p>List of configuration IDs to test for one-hop-away.</p>
        max_results: <p>Maximum number of results to return in a single page of output.</p>
        next_token: <p>Token to retrieve the next set of results. For example, if you previously specified 100 IDs for <code>ListServerNeighborsRequest$neighborConfigurationIds</code> but set <code>ListServerNeighborsRequest$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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_application_discovery_service.types.list_server_neighbors_request.ListServerNeighborsRequest]",
    ) -> AsyncOperationResponse[
        "capo_application_discovery_service.types.list_server_neighbors_response.ListServerNeighborsResponse"
    ]:
        import capo_application_discovery_service._operations.aws_poseidon_service_v2015_11_01.list_server_neighbors

        (
            output,
            http_response,
        ) = await capo_application_discovery_service._operations.aws_poseidon_service_v2015_11_01.list_server_neighbors.async_list_server_neighbors(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListServerNeighbors")
    )
    input_: capo_application_discovery_service.types.list_server_neighbors_request.ListServerNeighborsRequest = {
        "configuration_id": configuration_id
    }
    if port_information_needed is not None:
        input_["port_information_needed"] = port_information_needed
    if neighbor_configuration_ids is not None:
        input_["neighbor_configuration_ids"] = neighbor_configuration_ids
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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