def run(self):
    uri = self.arguments[0]

    try:
      handler = _RAPI_RESOURCES_FOR_DOCS[uri]
    except __HOLE__:
      raise self.error("Unknown resource URI '%s'" % uri)

    lines = [
      ".. list-table::",
      "   :widths: 1 4",
      "   :header-rows: 1",
      "",
      "   * - Method",
      "     - :ref:`Required permissions <rapi-users>`",
      ]

    for method in _GetHandlerMethods(handler):
      lines.extend([
        "   * - :ref:`%s <%s>`" % (method, _MakeRapiResourceLink(method, uri)),
        "     - %s" % _DescribeHandlerAccess(handler, method),
        ])

    # Inject into state machine
    include_lines = \
      docutils.statemachine.string2lines("\n".join(lines), _TAB_WIDTH,
                                         convert_whitespace=1)
    self.state_machine.insert_input(include_lines, self.__class__.__name__)

    return []
dataset/ETHPy150Open ganeti/ganeti/lib/build/sphinx_ext.py/RapiResourceDetails.run