Exemplo n.º 1
0
    kernel: "4.9.0-3-amd64"
    fqdn: "tomchop"
    install_date: 1480414461020000
  }}
  first_seen_at: 1480416002507491
  last_seen_at: {0:d}
  last_booted_at: 1507912328000000
  last_clock: 1511174989272124
  age: 1510710503319681
  client_id: "C.0000000000000001"
""".format(
    int((datetime.datetime.utcnow() - datetime.timedelta(25)).timestamp() *
        1000000))

MOCK_CLIENT = client.Client(data=text_format.Parse(client_proto1,
                                                   client_pb2.ApiClient()),
                            context=True)
MOCK_CLIENT_RECENT = client.Client(data=text_format.Parse(
    client_proto2, client_pb2.ApiClient()),
                                   context=True)
MOCK_CLIENT_LIST = [MOCK_CLIENT, MOCK_CLIENT_RECENT]

MOCK_CLIENT_REF = client.ClientRef(MOCK_CLIENT.client_id, context=True)

flow_pb_terminated = flow_pb2.ApiFlow(urn="C.0000000000000001",
                                      flow_id="F:12345",
                                      state=flows_pb2.FlowContext.TERMINATED)
flow_pb_error = flow_pb2.ApiFlow(urn="C.0000000000000001",
                                 flow_id="F:12345",
                                 state=flows_pb2.FlowContext.ERROR)
flow_pb_running = flow_pb2.ApiFlow(urn="C.0000000000000001",
Exemplo n.º 2
0
 def __init__(self):
     self.data = client_pb2.ApiClient()