# Copyright (c) 2015 iXsystems, Inc.
# All rights reserved.
# This file is a part of TrueNAS
# and may not be copied and/or distributed
# without the express permission of iXsystems.

import time

from freenasUI.api.utils import DojoResource


class PingResource(DojoResource):

    class Meta:
        allowed_methods = ['get']
        resource_name = 'system/ping'

    def get_list(self, request, **kwargs):
        response = self.create_response(request, {
            'time': time.time(),
            'message': 'pong',
        })
        return response
