'Rebuild a server with a new image.
For a full list of available parameters, please refer to the official
API reference:
https://developer.openstack.org/api-ref/compute/#rebuild-server-rebuild-action
Most parameters except the following are passed to the API without
any changes.
:param disk_config: The name is changed to OS-DCF:diskConfig'

def rebuild_server(self, server_id, image_ref, **kwargs):

    kwargs['imageRef'] = image_ref
    if ('disk_config' in kwargs):
        kwargs['OS-DCF:diskConfig'] = kwargs.pop('disk_config')
    schema = self.get_schema(self.schema_versions_info)
    if self.enable_instance_password:
        rebuild_schema = schema.rebuild_server_with_admin_pass
    else:
        rebuild_schema = schema.rebuild_server
    return self.action(server_id, 'rebuild', rebuild_schema, **kwargs)
