Exemple #1
0
def log_invoked_service(payload, invoked_service):
    rvi_node = "http://localhost:8801"
    service = "jlr.com/backend/logging/report/serviceinvoked"

    print "args:", payload
    # json_args = json.loads(payload)

    # print "json_args:", json_args
    rvi_args = [{
            'username': payload['username'],
            'vehicleVIN': payload['vehicleVIN'],
            'service': invoked_service,
            'latitude': payload['latitude'],
            'longitude': payload['longitude'],
            'timestamp': datetime.now().strftime('%Y-%m-%dT%H:%M:%S.000Z'),
            },
        ]
    print "rvi_args:", rvi_args
    rvi = RVI(rvi_node)
    rvi.message(service, rvi_args)
Exemple #2
0
def log_invoked_service(payload, invoked_service):
    rvi_node = "http://localhost:8801"
    service = "jlr.com/backend/logging/report/serviceinvoked"

    print "args:", payload
    # json_args = json.loads(payload)

    # print "json_args:", json_args
    rvi_args = [
        {
            'username': payload['username'],
            'vehicleVIN': payload['vehicleVIN'],
            'service': invoked_service,
            'latitude': payload['latitude'],
            'longitude': payload['longitude'],
            'timestamp': datetime.now().strftime('%Y-%m-%dT%H:%M:%S.000Z'),
        },
    ]
    print "rvi_args:", rvi_args
    rvi = RVI(rvi_node)
    rvi.message(service, rvi_args)
Exemple #3
0
    else:
        usage()

if len(args) < 1:
    usage()

# Construct a dictionary from the provided paths.
i = 0
service = args[0]
rvi_args = []
for i in args[1:]:
    print i
    [k, v] = i.split("=")
    rvi_args = rvi_args + [{k: v}]


#
# Setup an outbound JSON-RPC connection to the backend RVI node
# Service Edge.
#
rvi = RVI(rvi_node)

print "RVI Node:         ", rvi_node
print "Service:          ", service
print "args:             ", rvi_args

#
# Send the messge.
#
rvi.message(service, rvi_args)
Exemple #4
0
        rvi_node = a
    else:
        usage()

if len(args) < 1:
    usage()

# Construct a dictionary from the provided paths.
i = 0
service = args[0]
rvi_args = {}
for i in args[1:]:
    print i
    [k, v] = i.split('=')
    rvi_args[k] = v

#
# Setup an outbound JSON-RPC connection to the backend RVI node
# Service Edge.
#
rvi = RVI(rvi_node)

print "RVI Node:         ", rvi_node
print "Service:          ", service
print "args:             ", rvi_args

#
# Send the messge.
#
rvi.message(service, rvi_args)
Exemple #5
0
    line = raw_input('Enter <vin> <file_name> or "q" for quit: ')
    if line == 'q':
        rvi_server.shutdown()
        sys.exit(0)

    
        
    # Read a line and split it into a key val pair
    lst = line.split(' ')
    if len(lst) != 2:
        print "Nope", len(lst), lst
        continue
    
    [vin, file_name] = line.split(' ')
    dst = 'jlr.com/vin/'+vin+'/sota'
    try:
        f = open(file_name)
    except Err:
        print "Could not open",file_name,":", Err
        continue
    
    rvi_server.message(service_name = dst + "/notify",
                       timeout = int(time.time())+60,
                       parameters = [{ u'package': file_name,
                                       u'retry': transaction_id }])

    print "Queueing package ", file_name, " to ", dst
    package_queue.put([file_name, dst])

    print('Package {} sent to {}'. format(file_name, dst))
Exemple #6
0
# Construct a dictionary from the provided paths.
while i < len(sys.argv):
    print sys.argv[i]
    [k, v] = sys.argv[i].split('=')
    args = args + [{ k: v}]
    i = i + 1



#
# Setup an outbound JSON-RPC connection to the backend RVI node
# Service Edge.
#
rvi = RVI(rvi_node)


print "RVI Node:         ", rvi_node
print "Service:          ", service
print "args:             ", args

#
# Send the messge.
#
rvi.message(service, args)