opsgenie / opsgenie-go-sdk Goto Github PK
View Code? Open in Web Editor NEWOpsGenie Go SDK
License: Apache License 2.0
OpsGenie Go SDK
License: Apache License 2.0
Looking at https://docs.opsgenie.com/docs/schedule-api#section-get-schedule-timeline, I would expect a GetTimeline
method, similar to the v1 client (see https://godoc.org/github.com/opsgenie/opsgenie-go-sdk/client#OpsGenieScheduleClient)
panic: Server response can not be parsed, json: cannot unmarshal number 2269846187 into Go struct field Report.data.report.ackTime of type int32
through the api I'm trying to list alerts created. then I faced this issue
Hey,
I'm in a quite urgent need of the teamv2 API. I basically just need the List/GetAll call. Is it planned to add this soon? If not I will fallback to an HTTP call.
Thanks
I'm trying to use the Heartbeat API but when I do a List I get an error:
Unable to list existing heartbeats to sync: Client error occurred; Response Code: 410, Response Body: Heartbeat API v1 is deprecated. Please refer https://docs.opsgenie.com/docs/heartbeat-api for details of the new version
I think this is because the v1 api is still used for list: https://github.com/opsgenie/opsgenie-go-sdk/blob/master/client/opsgenie_heartbeat_client.go#L11
There is a v2 of the heartbeat REST api from what I can see: https://docs.opsgenie.com/docs/heartbeat-api#section-list-heartbeats
Happy to submit a PR to move to the new API if that would be useful
error:
Response Code: 400, Response Body: No handler found for url /v1/json/schedule/whoIsOnCall
from what I see from other clients it should be v1.1
The SDK uses a function to translate the request struct to URL Parameters, but those parameters are not aligned with the caps that the API requires.
For example the url parameter apiKey will become APIKey(which is based on the naming of the struct and not the naming of the JSON) - the result for that will be a request cannot have an empty apiKey value.
Hi,
I'm trying to figure out what is the way to access paged results of alerts in V2 ? Right now I get a list of alerts with maximal limit set ( 100 ) but alerts total number is bigger than this. :(
I query for alerts using query
which looks like
"createdAt > "2018-02-21T00:01:00Z" createdAt < "2018-03-14T23:39:00Z" teams:avengers entity:abc OR ABC"
So for now I created additional function within my app and this is the flow :
is used to determine if last item in array of alerts is within my timeframes of my provided query
// shouldCheckForMoreAlerts returns boolean value if last alert in returned list
// is within our requested timeframes
//
func shouldCheckForMoreAlerts(alerts []alertsv2.Alert, start, end time.Time) bool {
return inTimeSpan(start, end, alerts[len(alerts)-1].CreatedAt)
}
Within my app I then use the following piece of code to execute
opsGenieAlertsList, _ := listOpsGenieAlerts(alertsQuery, alertsOffset)
for checkForMore := true; checkForMore; checkForMore = (shouldCheckForMoreAlerts(opsGenieAlertsList.Alerts, beginAt, stopAt)) {
for _, singleAlert := range opsGenieAlertsList.Alerts {
// ...
// removed code for readability
}
alertsOffset += 20
opsGenieAlertsList, _ = listOpsGenieAlerts(alertsQuery, alertsOffset)
}
this is more less PoC
version than something final ;) - just FYI
Now my question would be what is suggested way ahead here ? Is this approach is okish
?
Any plans to add support for https://docs.opsgenie.com/docs/who-is-on-call-api?
https://api.opsgenie.com/v2/schedules/:scheduleIdentifier/on-calls
Currently using a v2 client and calling create()
returns an *AsyncRequestResponse
. Is it possible either now or in the future to return the ID
of the created alert either with the returned request response struct, or with a subsequent call using the returned request ID?
What’s the timeline for getting a fully functional SDK using the V2 apis?
When I want to create a new alert, it is not possible to create extra properties.
In the UI, it is possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.