コード例 #1
0
ファイル: simple.py プロジェクト: jdgwartney/sandbox
def createEvent(apiHost,
                apiKey,
                fingerprintFields,
                title,
                organizationID,
                source={
                    'ref': platform.node(),
                    'type': 'host'
                },
                severity=Event.INFO,
                sender={
                    'ref': platform.node(),
                    'type': 'host'
                },
                properties=None,
                status=Event.OK,
                tags=None,
                message=None,
                createdAt=None,
                receivedAt=None,
                eventId=None):
    c = EventConnection(apiKey=apiKey,
                        organizationID=organizationID,
                        apiHost=apiHost)

    e = Event(source, fingerprintFields, title, organizationID, severity,
              sender, properties, status, tags, message, createdAt, receivedAt,
              eventId)

    print(c.createEvent(e))
コード例 #2
0
ファイル: simple.py プロジェクト: jdgwartney/sandbox
def createEvent(apiHost,
                apiKey,
                fingerprintFields,
                title,
                organizationID,
                source = {'ref': platform.node(),'type': 'host'},
                severity=Event.INFO,
                sender={'ref': platform.node(),'type': 'host'},
                properties=None,
                status=Event.OK,
                tags=None,
                message=None,
                createdAt=None,
                receivedAt=None,
                eventId=None):
    c = EventConnection(apiKey=apiKey,organizationID=organizationID,apiHost=apiHost)
    
    e = Event(source,
              fingerprintFields,
              title,
              organizationID,
              severity,
              sender,
              properties,
              status,
              tags,
              message,
              createdAt,
              receivedAt,
              eventId)
    
    print(c.createEvent(e))
コード例 #3
0
    def testCreateEvent(self):
        # Create our Boundary Event Connection
        connection = EventConnection(self.apiKey, self.organizationID)
        event = Event.getDefaultEvent()

        #Send an event to the Boundary Server using the Boundary REST API
        eventID = connection.createEvent(event)
        self.assertIsNotNone(eventID, 'Check for returned event ID')
コード例 #4
0
 def testCreateEvent(self):
     # Create our Boundary Event Connection
     connection = EventConnection(self.apiKey,
                                  self.organizationID)
     event = Event.getDefaultEvent()
       
       
     #Send an event to the Boundary Server using the Boundary REST API
     eventID = connection.createEvent(event)
     self.assertIsNotNone(eventID,'Check for returned event ID')
コード例 #5
0
def main():
    k = 'ARI0PzUzWYUo7GG1OxiHmABTpr9'
    o = '3ehRi7uZeeaTN12dErF5XOnRXjC'
    connection = EventConnection(apiKey=k,organizationID=o)
    event = Event.getDefaultEvent()
    
    event.message = 'Hello World'
    event.title = 'Boundary Object Oriented Event API'
    
    eventId = connection.createEvent(event)
    
    print('event id: ' + str(eventId))
    
    newEvent = connection.getEvent(eventId)
    
    print('event: ' + newEvent)
コード例 #6
0
def main():
    k = 'ARI0PzUzWYUo7GG1OxiHmABTpr9'
    o = '3ehRi7uZeeaTN12dErF5XOnRXjC'
    connection = EventConnection(apiKey=k, organizationID=o)
    event = Event.getDefaultEvent()

    event.message = 'Hello World'
    event.title = 'Boundary Object Oriented Event API'

    eventId = connection.createEvent(event)

    print('event id: ' + str(eventId))

    newEvent = connection.getEvent(eventId)

    print('event: ' + newEvent)
コード例 #7
0
    def testGetEvent(self):
        connection = EventConnection(self.apiKey, self.organizationID)

        event = connection.getEvent(213299714)
        print('event_type {0}, event: {1}'.format(type(event), event))
コード例 #8
0
 def testGetEvent(self):
     connection = EventConnection(self.apiKey,
                                  self.organizationID)
       
     event = connection.getEvent(213299714)
     print('event_type {0}, event: {1}'.format(type(event),event))
コード例 #9
0
ファイル: simple.py プロジェクト: jdgwartney/sandbox
def getEvent(apiHost, apiKey, eventId):
    c = EventConnection(apiKey=apiKey, apiHost=apiHost)

    event = c.getEvent(eventId)
    return event
コード例 #10
0
ファイル: simple.py プロジェクト: jdgwartney/sandbox
def getEvent(apiHost,apiKey,eventId):
    c = EventConnection(apiKey=apiKey,apiHost=apiHost)
    
    event = c.getEvent(eventId)
    return event