#!/usr/bin/env python
#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#  @generated
#

from __future__ import print_function
from __future__ import absolute_import

import os
import sys

if (not sys.argv[0].endswith("par") and
    not sys.argv[0].endswith("xar") and
    os.getenv('PAR_UNPACK_TMP') == None):

    f = open(sys.argv[0], "r")

    f.readline() # This will be #!/bin/bash
    line = f.readline()
    f.close()

    # The par generator tool always has '# This par was made' as the
    # second line. See fbcode/tools/make_par/make_par.py
    if (not line.startswith('# This par was made')):
        print("""WARNING
        You are trying to run *-remote.py which is
        incorrect as the paths are not set up correctly.
        Instead, you should generate your thrift file with
        thrift_library and then run the resulting
        *-remote.par.
        For more information, please read
        http://fburl.com/python-remotes""")
        exit()

from . import MetaService
from . import ttypes

from nebula3.fbthrift.util.remote import Function
from nebula3.fbthrift.remote import Remote

FUNCTIONS = {
    'createSpace': Function('createSpace', 'MetaService', 'ExecResp', [('CreateSpaceReq', 'req', 'CreateSpaceReq')]),
    'dropSpace': Function('dropSpace', 'MetaService', 'ExecResp', [('DropSpaceReq', 'req', 'DropSpaceReq')]),
    'clearSpace': Function('clearSpace', 'MetaService', 'ExecResp', [('ClearSpaceReq', 'req', 'ClearSpaceReq')]),
    'getSpace': Function('getSpace', 'MetaService', 'GetSpaceResp', [('GetSpaceReq', 'req', 'GetSpaceReq')]),
    'listSpaces': Function('listSpaces', 'MetaService', 'ListSpacesResp', [('ListSpacesReq', 'req', 'ListSpacesReq')]),
    'alterSpace': Function('alterSpace', 'MetaService', 'ExecResp', [('AlterSpaceReq', 'req', 'AlterSpaceReq')]),
    'createSpaceAs': Function('createSpaceAs', 'MetaService', 'ExecResp', [('CreateSpaceAsReq', 'req', 'CreateSpaceAsReq')]),
    'createTag': Function('createTag', 'MetaService', 'ExecResp', [('CreateTagReq', 'req', 'CreateTagReq')]),
    'alterTag': Function('alterTag', 'MetaService', 'ExecResp', [('AlterTagReq', 'req', 'AlterTagReq')]),
    'dropTag': Function('dropTag', 'MetaService', 'ExecResp', [('DropTagReq', 'req', 'DropTagReq')]),
    'getTag': Function('getTag', 'MetaService', 'GetTagResp', [('GetTagReq', 'req', 'GetTagReq')]),
    'listTags': Function('listTags', 'MetaService', 'ListTagsResp', [('ListTagsReq', 'req', 'ListTagsReq')]),
    'createEdge': Function('createEdge', 'MetaService', 'ExecResp', [('CreateEdgeReq', 'req', 'CreateEdgeReq')]),
    'alterEdge': Function('alterEdge', 'MetaService', 'ExecResp', [('AlterEdgeReq', 'req', 'AlterEdgeReq')]),
    'dropEdge': Function('dropEdge', 'MetaService', 'ExecResp', [('DropEdgeReq', 'req', 'DropEdgeReq')]),
    'getEdge': Function('getEdge', 'MetaService', 'GetEdgeResp', [('GetEdgeReq', 'req', 'GetEdgeReq')]),
    'listEdges': Function('listEdges', 'MetaService', 'ListEdgesResp', [('ListEdgesReq', 'req', 'ListEdgesReq')]),
    'addHosts': Function('addHosts', 'MetaService', 'ExecResp', [('AddHostsReq', 'req', 'AddHostsReq')]),
    'addHostsIntoZone': Function('addHostsIntoZone', 'MetaService', 'ExecResp', [('AddHostsIntoZoneReq', 'req', 'AddHostsIntoZoneReq')]),
    'dropHosts': Function('dropHosts', 'MetaService', 'ExecResp', [('DropHostsReq', 'req', 'DropHostsReq')]),
    'listHosts': Function('listHosts', 'MetaService', 'ListHostsResp', [('ListHostsReq', 'req', 'ListHostsReq')]),
    'getPartsAlloc': Function('getPartsAlloc', 'MetaService', 'GetPartsAllocResp', [('GetPartsAllocReq', 'req', 'GetPartsAllocReq')]),
    'listParts': Function('listParts', 'MetaService', 'ListPartsResp', [('ListPartsReq', 'req', 'ListPartsReq')]),
    'getWorkerId': Function('getWorkerId', 'MetaService', 'GetWorkerIdResp', [('GetWorkerIdReq', 'req', 'GetWorkerIdReq')]),
    'createTagIndex': Function('createTagIndex', 'MetaService', 'ExecResp', [('CreateTagIndexReq', 'req', 'CreateTagIndexReq')]),
    'dropTagIndex': Function('dropTagIndex', 'MetaService', 'ExecResp', [('DropTagIndexReq', 'req', 'DropTagIndexReq')]),
    'getTagIndex': Function('getTagIndex', 'MetaService', 'GetTagIndexResp', [('GetTagIndexReq', 'req', 'GetTagIndexReq')]),
    'listTagIndexes': Function('listTagIndexes', 'MetaService', 'ListTagIndexesResp', [('ListTagIndexesReq', 'req', 'ListTagIndexesReq')]),
    'rebuildTagIndex': Function('rebuildTagIndex', 'MetaService', 'ExecResp', [('RebuildIndexReq', 'req', 'RebuildIndexReq')]),
    'listTagIndexStatus': Function('listTagIndexStatus', 'MetaService', 'ListIndexStatusResp', [('ListIndexStatusReq', 'req', 'ListIndexStatusReq')]),
    'createEdgeIndex': Function('createEdgeIndex', 'MetaService', 'ExecResp', [('CreateEdgeIndexReq', 'req', 'CreateEdgeIndexReq')]),
    'dropEdgeIndex': Function('dropEdgeIndex', 'MetaService', 'ExecResp', [('DropEdgeIndexReq', 'req', 'DropEdgeIndexReq')]),
    'getEdgeIndex': Function('getEdgeIndex', 'MetaService', 'GetEdgeIndexResp', [('GetEdgeIndexReq', 'req', 'GetEdgeIndexReq')]),
    'listEdgeIndexes': Function('listEdgeIndexes', 'MetaService', 'ListEdgeIndexesResp', [('ListEdgeIndexesReq', 'req', 'ListEdgeIndexesReq')]),
    'rebuildEdgeIndex': Function('rebuildEdgeIndex', 'MetaService', 'ExecResp', [('RebuildIndexReq', 'req', 'RebuildIndexReq')]),
    'listEdgeIndexStatus': Function('listEdgeIndexStatus', 'MetaService', 'ListIndexStatusResp', [('ListIndexStatusReq', 'req', 'ListIndexStatusReq')]),
    'createUser': Function('createUser', 'MetaService', 'ExecResp', [('CreateUserReq', 'req', 'CreateUserReq')]),
    'dropUser': Function('dropUser', 'MetaService', 'ExecResp', [('DropUserReq', 'req', 'DropUserReq')]),
    'alterUser': Function('alterUser', 'MetaService', 'ExecResp', [('AlterUserReq', 'req', 'AlterUserReq')]),
    'grantRole': Function('grantRole', 'MetaService', 'ExecResp', [('GrantRoleReq', 'req', 'GrantRoleReq')]),
    'revokeRole': Function('revokeRole', 'MetaService', 'ExecResp', [('RevokeRoleReq', 'req', 'RevokeRoleReq')]),
    'listUsers': Function('listUsers', 'MetaService', 'ListUsersResp', [('ListUsersReq', 'req', 'ListUsersReq')]),
    'listRoles': Function('listRoles', 'MetaService', 'ListRolesResp', [('ListRolesReq', 'req', 'ListRolesReq')]),
    'getUserRoles': Function('getUserRoles', 'MetaService', 'ListRolesResp', [('GetUserRolesReq', 'req', 'GetUserRolesReq')]),
    'changePassword': Function('changePassword', 'MetaService', 'ExecResp', [('ChangePasswordReq', 'req', 'ChangePasswordReq')]),
    'heartBeat': Function('heartBeat', 'MetaService', 'HBResp', [('HBReq', 'req', 'HBReq')]),
    'agentHeartbeat': Function('agentHeartbeat', 'MetaService', 'AgentHBResp', [('AgentHBReq', 'req', 'AgentHBReq')]),
    'regConfig': Function('regConfig', 'MetaService', 'ExecResp', [('RegConfigReq', 'req', 'RegConfigReq')]),
    'getConfig': Function('getConfig', 'MetaService', 'GetConfigResp', [('GetConfigReq', 'req', 'GetConfigReq')]),
    'setConfig': Function('setConfig', 'MetaService', 'ExecResp', [('SetConfigReq', 'req', 'SetConfigReq')]),
    'listConfigs': Function('listConfigs', 'MetaService', 'ListConfigsResp', [('ListConfigsReq', 'req', 'ListConfigsReq')]),
    'createSnapshot': Function('createSnapshot', 'MetaService', 'ExecResp', [('CreateSnapshotReq', 'req', 'CreateSnapshotReq')]),
    'dropSnapshot': Function('dropSnapshot', 'MetaService', 'ExecResp', [('DropSnapshotReq', 'req', 'DropSnapshotReq')]),
    'listSnapshots': Function('listSnapshots', 'MetaService', 'ListSnapshotsResp', [('ListSnapshotsReq', 'req', 'ListSnapshotsReq')]),
    'runAdminJob': Function('runAdminJob', 'MetaService', 'AdminJobResp', [('AdminJobReq', 'req', 'AdminJobReq')]),
    'mergeZone': Function('mergeZone', 'MetaService', 'ExecResp', [('MergeZoneReq', 'req', 'MergeZoneReq')]),
    'dropZone': Function('dropZone', 'MetaService', 'ExecResp', [('DropZoneReq', 'req', 'DropZoneReq')]),
    'divideZone': Function('divideZone', 'MetaService', 'ExecResp', [('DivideZoneReq', 'req', 'DivideZoneReq')]),
    'renameZone': Function('renameZone', 'MetaService', 'ExecResp', [('RenameZoneReq', 'req', 'RenameZoneReq')]),
    'getZone': Function('getZone', 'MetaService', 'GetZoneResp', [('GetZoneReq', 'req', 'GetZoneReq')]),
    'listZones': Function('listZones', 'MetaService', 'ListZonesResp', [('ListZonesReq', 'req', 'ListZonesReq')]),
    'addListener': Function('addListener', 'MetaService', 'ExecResp', [('AddListenerReq', 'req', 'AddListenerReq')]),
    'removeListener': Function('removeListener', 'MetaService', 'ExecResp', [('RemoveListenerReq', 'req', 'RemoveListenerReq')]),
    'listListener': Function('listListener', 'MetaService', 'ListListenerResp', [('ListListenerReq', 'req', 'ListListenerReq')]),
    'getStats': Function('getStats', 'MetaService', 'GetStatsResp', [('GetStatsReq', 'req', 'GetStatsReq')]),
    'signInService': Function('signInService', 'MetaService', 'ExecResp', [('SignInServiceReq', 'req', 'SignInServiceReq')]),
    'signOutService': Function('signOutService', 'MetaService', 'ExecResp', [('SignOutServiceReq', 'req', 'SignOutServiceReq')]),
    'listServiceClients': Function('listServiceClients', 'MetaService', 'ListServiceClientsResp', [('ListServiceClientsReq', 'req', 'ListServiceClientsReq')]),
    'createFTIndex': Function('createFTIndex', 'MetaService', 'ExecResp', [('CreateFTIndexReq', 'req', 'CreateFTIndexReq')]),
    'dropFTIndex': Function('dropFTIndex', 'MetaService', 'ExecResp', [('DropFTIndexReq', 'req', 'DropFTIndexReq')]),
    'listFTIndexes': Function('listFTIndexes', 'MetaService', 'ListFTIndexesResp', [('ListFTIndexesReq', 'req', 'ListFTIndexesReq')]),
    'createSession': Function('createSession', 'MetaService', 'CreateSessionResp', [('CreateSessionReq', 'req', 'CreateSessionReq')]),
    'updateSessions': Function('updateSessions', 'MetaService', 'UpdateSessionsResp', [('UpdateSessionsReq', 'req', 'UpdateSessionsReq')]),
    'listSessions': Function('listSessions', 'MetaService', 'ListSessionsResp', [('ListSessionsReq', 'req', 'ListSessionsReq')]),
    'getSession': Function('getSession', 'MetaService', 'GetSessionResp', [('GetSessionReq', 'req', 'GetSessionReq')]),
    'removeSession': Function('removeSession', 'MetaService', 'RemoveSessionResp', [('RemoveSessionReq', 'req', 'RemoveSessionReq')]),
    'killQuery': Function('killQuery', 'MetaService', 'ExecResp', [('KillQueryReq', 'req', 'KillQueryReq')]),
    'reportTaskFinish': Function('reportTaskFinish', 'MetaService', 'ExecResp', [('ReportTaskReq', 'req', 'ReportTaskReq')]),
    'createBackup': Function('createBackup', 'MetaService', 'CreateBackupResp', [('CreateBackupReq', 'req', 'CreateBackupReq')]),
    'restoreMeta': Function('restoreMeta', 'MetaService', 'RestoreMetaResp', [('RestoreMetaReq', 'req', 'RestoreMetaReq')]),
    'listCluster': Function('listCluster', 'MetaService', 'ListClusterInfoResp', [('ListClusterInfoReq', 'req', 'ListClusterInfoReq')]),
    'getMetaDirInfo': Function('getMetaDirInfo', 'MetaService', 'GetMetaDirInfoResp', [('GetMetaDirInfoReq', 'req', 'GetMetaDirInfoReq')]),
    'verifyClientVersion': Function('verifyClientVersion', 'MetaService', 'VerifyClientVersionResp', [('VerifyClientVersionReq', 'req', 'VerifyClientVersionReq')]),
    'saveGraphVersion': Function('saveGraphVersion', 'MetaService', 'SaveGraphVersionResp', [('SaveGraphVersionReq', 'req', 'SaveGraphVersionReq')]),
    'getSegmentId': Function('getSegmentId', 'MetaService', 'GetSegmentIdResp', [('GetSegmentIdReq', 'req', 'GetSegmentIdReq')]),
}

SERVICE_NAMES = ['MetaService', ]

if __name__ == '__main__':
    Remote.run(FUNCTIONS, SERVICE_NAMES, MetaService, ttypes, sys.argv, default_port=9090)
