Exemplo n.º 1
0
def delete(args):
    import processing

    # for DELETE HTTP method
    action = False

    # for delete sub-command
    if args.__dict__.get('domain'):

        from converter import JSONConvert
        domain = args.domain
        o = JSONConvert(domain)

        name, rtype, content, ttl, priority = getRecordParameters(args)
        record_dict = o.setRecord(name, rtype, content, ttl, priority)

        json = setJSON(domain, action, record=record_dict)

    # for bulk_delete sub-command
    else:

        domain = checkInfile(args.infile)
        json = setJSON(domain, action, filename=args.infile)

    password = getPassword(args)
    t = token(args.username, password, args.server)
    processing.deleteRecords(args.server, t, json)
Exemplo n.º 2
0
def delete(args):
    import processing
    if args.__dict__.get('domain'):
        domain = args.domain
        from converter import JSONConvert
        o = JSONConvert(domain)
        name, rtype, content, ttl, priority = args.name, args.rtype, \
            args.content, args.ttl, args.priority
        record_dict = o.setRecord(name, rtype, content, ttl, priority)
        json = setJSON(domain, False, record=record_dict)
    else:
        domain = checkInfile(args.infile)
        json = setJSON(domain, False, filename=args.infile)
    password = getPassword(args)
    t = token(args.username, password, args.server)
    processing.deleteRecords(args.server, t, json)