:doc:`ApplicationDiscoveryService <../../discovery>` / Client / list_server_neighbors

*********************
list_server_neighbors
*********************



.. py:method:: ApplicationDiscoveryService.Client.list_server_neighbors(**kwargs)

  

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

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/discovery-2015-11-01/ListServerNeighbors>`_  


  **Request Syntax**
  ::

    response = client.list_server_neighbors(
        configurationId='string',
        portInformationNeeded=True|False,
        neighborConfigurationIds=[
            'string',
        ],
        maxResults=123,
        nextToken='string'
    )
    
  :type configurationId: string
  :param configurationId: **[REQUIRED]** 

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

    

  
  :type portInformationNeeded: boolean
  :param portInformationNeeded: 

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

    

  
  :type neighborConfigurationIds: list
  :param neighborConfigurationIds: 

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

    

  
    - *(string) --* 

    

  :type maxResults: integer
  :param maxResults: 

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

    

  
  :type nextToken: string
  :param nextToken: 

    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.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'neighbors': [
              {
                  'sourceServerId': 'string',
                  'destinationServerId': 'string',
                  'destinationPort': 123,
                  'transportProtocol': 'string',
                  'connectionsCount': 123
              },
          ],
          'nextToken': 'string',
          'knownDependencyCount': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **neighbors** *(list) --* 

        List of distinct servers that are one hop away from the given server.

        
        

        - *(dict) --* 

          Details about neighboring servers.

          
          

          - **sourceServerId** *(string) --* 

            The ID of the server that opened the network connection.

            
          

          - **destinationServerId** *(string) --* 

            The ID of the server that accepted the network connection.

            
          

          - **destinationPort** *(integer) --* 

            The destination network port for the connection.

            
          

          - **transportProtocol** *(string) --* 

            The network protocol used for the connection.

            
          

          - **connectionsCount** *(integer) --* 

            The number of open network connections with the neighboring server.

            
      
    
      

      - **nextToken** *(string) --* 

        Token to retrieve the next set of results. For example, if you specified 100 IDs for ``ListServerNeighborsRequest$neighborConfigurationIds`` but set ``ListServerNeighborsRequest$maxResults`` to 10, you received a set of 10 results along with this token. Use this token in the next query to retrieve the next set of 10.

        
      

      - **knownDependencyCount** *(integer) --* 

        Count of distinct servers that are one hop away from the given server.

        
  
  **Exceptions**
  
  *   :py:class:`ApplicationDiscoveryService.Client.exceptions.AuthorizationErrorException`

  
  *   :py:class:`ApplicationDiscoveryService.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`ApplicationDiscoveryService.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`ApplicationDiscoveryService.Client.exceptions.ServerInternalErrorException`

  
  *   :py:class:`ApplicationDiscoveryService.Client.exceptions.HomeRegionNotSetException`

  