Skip to content

Instantly share code, notes, and snippets.

@islamgulov
Created July 7, 2012 22:20
Show Gist options
  • Save islamgulov/3068307 to your computer and use it in GitHub Desktop.
Save islamgulov/3068307 to your computer and use it in GitHub Desktop.
Example response for supported method

Fake method:

class FakeDriver(object):
    def fake_method(self, node, volume, device='default_value', extra={}):
        """
        teachess volume to node.

        @param      node: Node to attach volume to
        @type       node: L{Node}

        @param      volume: Volume to attach
        @type       volume: C{str}

        @param      device: Where the device is exposed,
                            e.g. '/dev/sdb (required)
        @type       device: C{str}

        @param extra: Extra attributes (driver specific).
        @type extra: C{dict}

        @return: C{str}
        """
        pass

Method description:

{
    "arguments": [
        {
            "required": true,
            "type": "string",
            "name": "node_id",
            "description": "ID of the node which should be used"
        },
        {
            "required": true,
            "type": "string",
            "name": "volume",
            "description": "Volume to attach"
        },
        {
            "required": true,
            "type": "string",
            "name": "device",
            "description": "Where the device is exposed,\ne.g. '/dev/sdb (required)"
        },
        {
            "default": {},
            "required": false,
            "type": "dictionary",
            "name": "extra",
            "description": "Extra attributes (driver specific)."
        }
    ],
    "name": "fake_method",
    "description": "teachess volume to node."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment