Пример #1
0
def main(argv=None):
    parser = argparse.ArgumentParser()
    parser.add_argument('-u',
                        '--url',
                        help='the url',
                        metavar='URL',
                        required=True)
    parser.add_argument('-t',
                        '--timeout',
                        help='the shutdown timeout',
                        metavar='Seconds',
                        default=0,
                        type=int)
    parser.add_argument('-f',
                        '--force',
                        help='force shutdown',
                        action='store_true',
                        default=False)
    args = parser.parse_args()

    url = args.url
    timeout = args.timeout
    force = args.force

    res = request.post(url + '/shutdown', {'timeout': timeout, 'force': force})
    request.print_response(res)
Пример #2
0
def main(argv=None):
    parser = argparse.ArgumentParser()
    parser.add_argument('-u', '--url', help='the url', metavar='URL', required=True)
    args = parser.parse_args()

    url = args.url

    res = request.get(url + '/processlist')
    request.print_response(res)
Пример #3
0
def main(argv=None):
    parser = argparse.ArgumentParser()
    parser.add_argument('-u', '--url', help='the url', metavar='URL', required=True)
    parser.add_argument('-i', '--serverid', help='the server id', metavar='ID', required=True)
    parser.add_argument('-s', '--settings', help='additional server settings (colon separated)', metavar='SETTINGS', required=False)
    args = parser.parse_args()

    url = args.url
    serverId = args.serverid
    settings = args.settings

    args = {
        'serverId': serverId
    }

    if settings is not None:
        args['settings'] = settings

    res = request.post(url + '/runparsec', args)
    request.print_response(res)
Пример #4
0
def main(argv=None):
    parser = argparse.ArgumentParser()
    parser.add_argument('-u',
                        '--url',
                        help='the url',
                        metavar='URL',
                        required=True)
    parser.add_argument('-p',
                        '--pid',
                        help='the PID',
                        metavar='PID',
                        required=True,
                        type=int)
    args = parser.parse_args()

    url = args.url
    pid = args.pid

    res = request.post(url + '/killprocess', {'pid': pid})
    request.print_response(res)