def RecreateInstanceDisks(r, instance, disks=None, nodes=None):
    """Recreate an instance's disks.

    @type instance: string
    @param instance: Instance name
    @type disks: list of int
    @param disks: List of disk indexes
    @type nodes: list of string
    @param nodes: New instance nodes, if relocation is desired
    @rtype: string
    @return: job id
    """

    body = {}

    if disks is not None:
        body["disks"] = disks
    if nodes is not None:
        body["nodes"] = nodes

    return r.request("post", "/2/instances/%s/recreate-disks" % instance,
                     content=body)
Recreate an instance's disks.

    @type instance: string
    @param instance: Instance name
    @type disks: list of int
    @param disks: List of disk indexes
    @type nodes: list of string
    @param nodes: New instance nodes, if relocation is desired
    @rtype: string
    @return: job id