|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiz.neustar.pagerduty.PagerDutyClient
public class PagerDutyClient
| Constructor Summary | |
|---|---|
PagerDutyClient(String subdomain,
String username,
String password)
|
|
| Method Summary | |
|---|---|
EventResponse |
acknowledge(String serviceKey,
String description,
String incidentKey,
Object details)
Acknowledges an existing event in PagerDuty for the supplied service and incident key, including an optional description and details to go along with the message. |
List<Incident> |
getIncidents(Date start,
Date end,
IncidentsQuery query)
Returns the incidents based on the supplied date range and query parameters. |
int |
getIncidentsCount(Date start,
Date end,
IncidentsQuery query)
Returns the count of incidents based on the supplied date range and query parameters. |
EventResponse |
resolve(String serviceKey,
String description,
String incidentKey,
Object details)
Resolves an existing event in PagerDuty for the supplied service and incident key, including an optional description and details to go along with the message. |
EventResponse |
trigger(String serviceKey,
String description,
String incidentKey,
Object details)
Triggers a new incident in PagerDuty for the supplied service, including an optional description, incident key, and details to go along with the message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Inject
public PagerDutyClient(@Named(value="pagerduty.subdomain")
String subdomain,
@Named(value="pagerduty.username")
String username,
@Named(value="pagerduty.password")
String password)
| Method Detail |
|---|
public int getIncidentsCount(Date start,
Date end,
IncidentsQuery query)
throws IOException,
QueryException,
InternalException
start - the start of the query rangeend - the end of the query rangequery - the query details, such as new IncidentsQuery().sortBy(RESOLVED_ON, ASC).withStatus("resolved")
IOException - when there is an IO problem such as making a network request
QueryException - when PagerDuty rejects the query being made and responds with an error and reason
InternalException - when PagerDuty returns a 5xx error code
public List<Incident> getIncidents(Date start,
Date end,
IncidentsQuery query)
throws IOException,
QueryException,
InternalException
start - the start of the query rangeend - the end of the query rangequery - the query details, such as new IncidentsQuery().sortBy(RESOLVED_ON, ASC).withStatus("resolved")
IOException - when there is an IO problem such as making a network request
QueryException - when PagerDuty rejects the query being made and responds with an error and reason
InternalException - when PagerDuty returns a 5xx error code
public EventResponse trigger(String serviceKey,
String description,
String incidentKey,
Object details)
throws IOException,
InternalException,
InvalidEventException
serviceKey - the service key to for the incidentdescription - an optional description for the incidentincidentKey - an optional key (if not supplied, PagerDuty will generate one and return it)details - an object that will be converted to a JSON structure and included with the incident details (can be Map, real object, etc)
IOException - when there is an IO problem such as making a network request
InternalException - when a 5xx response code is returned
InvalidEventException - when a 400 response code is returned, indicating that the event supplied is invalid
public EventResponse acknowledge(String serviceKey,
String description,
String incidentKey,
Object details)
throws IOException,
InternalException,
InvalidEventException
serviceKey - the service key to for the incidentdescription - an optional description for the incidentincidentKey - a required incident key that maps to the incident you wish to acknowledgedetails - an object that will be converted to a JSON structure and included with the incident details (can be Map, real object, etc)
IOException - when there is an IO problem such as making a network request
InternalException - when a 5xx response code is returned
InvalidEventException - when a 400 response code is returned, indicating that the event supplied is invalid
public EventResponse resolve(String serviceKey,
String description,
String incidentKey,
Object details)
throws IOException,
InternalException,
InvalidEventException
serviceKey - the service key to for the incidentdescription - an optional description for the incidentincidentKey - a required incident key that maps to the incident you wish to acknowledgedetails - an object that will be converted to a JSON structure and included with the incident details (can be Map, real object, etc)
IOException - when there is an IO problem such as making a network request
InternalException - when a 5xx response code is returned
InvalidEventException - when a 400 response code is returned, indicating that the event supplied is invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||