@resources.command(ignore_defaults=True, no_args_is_help=False)<EOL><INDENT>@click.option('<STR_LIT>', is_flag=True, default=False,<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', help='<STR_LIT>')<EOL>def list(self, root=False, **kwargs):<DEDENT>
<EOL>if kwargs.get('<STR_LIT>', None):<EOL><INDENT>self.set_child_endpoint(parent=kwargs['<STR_LIT>'], inventory=kwargs.get('<STR_LIT>', None))<EOL>kwargs.pop('<STR_LIT>')<EOL><DEDENT>if root and not kwargs.get('<STR_LIT>', None):<EOL><INDENT>raise exc.UsageError('<STR_LIT>')<EOL><DEDENT>if root:<EOL><INDENT>inventory_id = kwargs['<STR_LIT>']<EOL>r = client.get('<STR_LIT>' % inventory_id)<EOL>return r.json()<EOL><DEDENT>return super(Resource, self).list(**kwargs)<EOL>
Return a list of groups.

        =====API DOCS=====
        Retrieve a list of groups.

        :param root: Flag that if set, only root groups of a specific inventory will be listed.
        :type root: bool
        :param parent: Primary key or name of the group whose child groups will be listed.
        :type parent: str
        :param all_pages: Flag that if set, collect all pages of content from the API when returning results.
        :type all_pages: bool
        :param page: The page to show. Ignored if all_pages is set.
        :type page: int
        :param query: Contains 2-tuples used as query parameters to filter resulting resource objects.
        :type query: list
        :param `**kwargs`: Keyword arguments list of available fields used for searching resource objects.
        :returns: A JSON object containing details of all resource objects returned by Tower backend.
        :rtype: dict
        :raises tower_cli.exceptions.UsageError: When ``root`` flag is on and ``inventory`` is not present in
                                                 ``**kwargs``.

        =====API DOCS=====