Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting event details from log_entries #47

Closed
i5uhail opened this issue May 2, 2016 · 4 comments
Closed

getting event details from log_entries #47

i5uhail opened this issue May 2, 2016 · 4 comments
Assignees

Comments

@i5uhail
Copy link

i5uhail commented May 2, 2016

I am new to pygerduty and still exploring.

I have a case were i need to get the event details from a log entry...

I know get_trigger_log_entry() gets me the details but the return i am getting is just
<LogEntry: contexts=[], created_at=u'2016-05-02T11:42:42Z', agent=<Container: type=u'service'>, type=u'trigger', id=u'someID', channel=<Container: type=u'email', summary=u'SomeSummary'>>

Is there a way i can completely get this info with pygerduty. The return of incidents.show has the link to
the log entry but does not give me the content of it.

Is there an attribute to get this content that I am missing.

Can some one please help me with my requirement. Thanks in advance.

@gmjosack gmjosack self-assigned this May 2, 2016
@gmjosack
Copy link
Contributor

gmjosack commented May 2, 2016

pygerduty is a pretty thin wrapper around the API and can do most things the API can do. If you want to get a list of LogEntry's from an incident then you could call log_entries.list() on an incident. For example:

incident = pd.incidents.list().next()
for entry in incident.log_entries.list():
    print entry

Let me know if this is not what you're asking.

@i5uhail
Copy link
Author

i5uhail commented May 3, 2016

Thanks a lot for getting back @gmjosack

I will be a bit more specific. I am looking for additional details of my alerts like body of the alerts which i can get from the pagerduty api

https://(SomeDomain).pagerduty.com/api/v1/incidents/(:id)/log_entries/(LogEntry:id)?include[]=channel

is there a pygerduty way of fetching this details. Thanks in advance.

@gmjosack
Copy link
Contributor

gmjosack commented May 3, 2016

I believe that should work as one of the following:

incident.log_entries.list(include=["channel"])

or

incident.log_entries.show("SOME_ENTRY_ID", include=["channel"])

@i5uhail
Copy link
Author

i5uhail commented May 8, 2016

Thanks a lot @gmjosack that worked.

@i5uhail i5uhail closed this as completed May 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants