code: def get_node_list(self) -> list:
          
          # Initialising empty list
          nodes = []
  
          # Raise an exception if we are not a manager
          if not self._manager:
              raise RuntimeError('Only the Swarm manager node '
                                 'can retrieve all the nodes.')
  
          node_list = self._client.nodes.list()
          for n_list in node_list:
              nodes.append(n_list.id)
          return nodes
docs: Get a list of nodes.
  
          Only the manager nodes can retrieve all the nodes
  
          Returns:
              list, all the ids of the nodes in swarm