Manage incidents from ring to retro
Developer-friendly & type-safe Go SDK specifically catered to leverage FireHydrant API.
- SDK Installation
- SDK Example Usage
- Available Resources and Operations
- Retries
- Error Handling
- Server Selection
- Custom HTTP Client
- Authentication
- Special Types
To add the SDK as a dependency to your project:
go get github.com/speakeasy-sdks/firehydrant-go-sdk
This SDK supports the following security scheme globally:
Name | Type | Scheme |
---|---|---|
APIKey |
apiKey | API key |
You can configure it using the WithSecurity
option when initializing the SDK client instance. For example:
package main
import (
"context"
"firehydrant"
"log"
)
func main() {
s := firehydrant.New(
firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.AccountSettings.GetAiPreferences(ctx)
if err != nil {
log.Fatal(err)
}
if res.AIEntitiesPreferencesEntity != nil {
// handle response
}
}
package main
import (
"context"
"firehydrant"
"log"
)
func main() {
s := firehydrant.New(
firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.AccountSettings.GetAiPreferences(ctx)
if err != nil {
log.Fatal(err)
}
if res.AIEntitiesPreferencesEntity != nil {
// handle response
}
}
Available methods
- GetAiPreferences - Get AI preferences
- UpdateAiPreferences - Update AI preferences
- VoteOnIncidentSummary - Vote on an AI-generated incident summary
- GetBootstrap - Get initial application configuration and settings
- ListEntitlements - List entitlements
- Ping - Check API connectivity
- GetSavedSearch - Get a saved search
- DeleteSavedSearch - Delete a saved search
- UpdateSavedSearch - Update a saved search
- List - List alerts
- Get - Get an alert
- ListForIncident - List alerts for an incident
- Create - Attach alerts to an incident
- ListProcessingLogs - List alert processing log entries
- List - List events for an AWS CloudTrail batch
- ListTypes - List change types
- List - List changes
- Create - Create a change
- ListEvents - List change events
- CreateEvent - Create a change event
- GetEvent - Get a change event
- DeleteEvent - Delete a change event
- UpdateEvent - Update a change event
- Delete - Archive a change
- Update - Update a change
- ListIdentities - List identities for a change
- CreateIdentity - Create an identity for a change
- DeleteIdentity - Delete an identity from a change
- UpdateIdentity - Update an identity for a change
- Get - Get a scheduled maintenance event
- UpdateScheduledMaintenance - Update a scheduled maintenance event
- Get - Get a checklist template
- ListTemplates - List status update templates
- GetTemplate - Get a status update template
- DeleteStatusUpdateTemplate - Delete a status update template
- UpdateTemplate - Update a status update template
- ListSpaces - List Confluence spaces
- ListComments - List comments for a conversation
- CreateComment - Create a comment for a conversation
- GetComment - Get a conversation comment
- DeleteComment - Delete a conversation comment
- UpdateComment - Update a conversation comment
- ListCommentReactions - List reactions for a conversation comment
- CreateCommentReaction - Create a reaction for a conversation comment
- DeleteCommentReaction - Delete a reaction from a conversation comment
- List - List environments
- Create - Create an environment
- Get - Get an environment
- Delete - Archive an environment
- Update - Update an environment
- List - List functionalities
- Create - Create a functionality
- Get - Get a functionality
- Delete - Archive a functionality
- Update - Update a functionality
- ListServices - List services for a functionality
- GetAiSummaryVoteStatus - Get the vote status for an AI-generated incident summary
- List - List incidents
- Create - Create an incident
- Get - Get an incident
- Archive - Archive an incident
- Update - Update an incident
- DeleteAlert - Delete an alert from an incident
- SetAlertAsPrimary - Set an alert as primary for an incident
- ListAttachments - List attachments for an incident
- CreateAttachment - Create an attachment for an incident
- GetChannel - Get chat channel information for an incident
- Close - Close an incident
- ListEvents - List events for an incident
- GetEvent - Get an incident event
- DeleteEvent - Delete an incident event
- UpdateEvent - Update an incident event
- UpdateEventVotes - Update votes for an incident event
- GetEventVoteStatus - Get vote counts for an incident event
- CreateGenericChatMessage - Create a chat message for an incident
- DeleteChatMessage - Delete a chat message from an incident
- UpdateChatMessage - Update a chat message in an incident
- UpdateImpacts - Replace all impacts for an incident
- PartialUpdateImpacts - Update impacts for an incident
- ListImpact - List impacted infrastructure for an incident
- CreateImpact - Add impacted infrastructure to an incident
- DeleteImpact - Remove impacted infrastructure from an incident
- ListLinks - List links for an incident
- CreateLink - Create a link for an incident
- UpdateLink - Update an external link for an incident
- DeleteLink - Delete an external link from an incident
- ListMilestones - List milestones for an incident
- UpdateMilestonesBulk - Bulk update milestone timestamps for an incident
- CreateNote - Create a note for an incident
- UpdateNote - Update a note for an incident
- ListRelatedChangeEvents - List related changes for an incident
- CreateRelatedChange - Add a related change to an incident
- UpdateRelatedChangeEvent - Update a related change event for an incident
- GetRelationships - List incident relationships
- Resolve - Resolve an incident
- ListRoleAssignments - List role assignments for an incident
- CreateRoleAssignment - Create a role assignment for an incident
- DeleteRoleAssignment - Delete a role assignment from an incident
- ListSimilar - List similar incidents
- ListStatusPages - List status pages for an incident
- AddStatusPage - Add a status page to an incident
- CreateTaskList - Add tasks from a task list to an incident
- CreateTeamAssignment - Assign a team to an incident
- DeleteTeamAssignment - Remove a team assignment from an incident
- GetTranscript - List transcript messages for an incident
- DeleteTranscript - Delete a transcript from an incident
- Unarchive - Unarchive an incident
- GetUserRole - Get a user's role in an incident
- ListCustomFieldDefinitions - List custom field definitions
- CreateCustomFieldDefinition - Create a custom field definition
- DeleteCustomFieldDefinition - Delete a custom field definition
- UpdateCustomFieldDefinition - Update a custom field definition
- ListSelectOptions - List select options for a custom field
- GetFormConfiguration - Get a form configuration
- ListRoles - List incident roles
- CreateIncidentRole - Create an incident role
- GetIncidentRole - Get an incident role
- DeleteRole - Archive an incident role
- UpdateIncidentRole - Update an incident role
- ListIncidentTags - List incident tags
- ValidateIncidentTags - Validate incident tags
- ListIncidentTypes - List incident types
- CreateIncidentType - Create an incident type
- GetIncidentType - Get an incident type
- ArchiveIncidentType - Archive an incident type
- UpdateType - Update an incident type
- CreateMilestone - Create a milestone for an incident lifecycle
- DeleteLifecycleMilestone - Delete a lifecycle milestone
- UpdateLifecycleMilestone - Update a lifecycle milestone
- ListLifecyclePhases - List lifecycle phases and milestones
- ListPriorities - List priorities
- CreatePriority - Create a priority
- GetPriority - Get a priority
- DeletePriority - Delete a priority
- UpdatePriority - Update a priority
- ListSeverities - List severities
- CreateSeverity - Create a severity
- GetSeverity - Get a severity
- DeleteSeverity - Delete a severity
- UpdateSeverity - Update a severity
- GetSeverityMatrix - Get severity matrix
- UpdateSeverityMatrix - Update severity matrix
- ListSeverityMatrixConditions - List severity matrix conditions
- CreateSeverityMatrixCondition - Create a severity matrix condition
- GetSeverityMatrixCondition - Get a severity matrix condition
- DeleteSeverityMatrixCondition - Delete a severity matrix condition
- UpdateCondition - Update a severity matrix condition
- ListSeverityMatrixImpacts - List severity matrix impacts
- CreateImpact - Create a severity matrix impact
- DeleteSeverityMatrixImpact - Delete an impact from the severity matrix
- UpdateImpact - Update an impact in the severity matrix
- ListTicketingPriorities - List ticketing priorities
- CreateTicketingPriority - Create a ticketing priority
- List - List catalog entries
- List - List all available integrations
- ListCloudtrailBatches - List AWS CloudTrail batches
- UpdateCloudTrailBatch - Update an AWS CloudTrail batch
- ListConnections - List integration connections
- CreateConnection - Create a new integration connection
- UpdateConnection - Update an integration connection
- RefreshConnection - Refresh an integration connection
- UpdateFieldMap - Update a field mapping configuration
- GetFieldMapAvailableFields - List available fields for field mapping
- ListEmojiActions - List Slack emoji actions
- GetStatus - Get an integration status
- GetStatuspageConnection - Get a Statuspage connection
- DeleteStatuspageConnection - Delete a Statuspage connection
- Get - Get an integration
- DeletePriority - Delete a ticketing priority
- UpdatePriority - Update a ticketing priority
- ListProjects - List ticketing projects
- GetProjectConfigurationOptions - List configuration options for a ticketing project
- GetProjectFieldOptions - List configuration options for a ticketing project field
- CreateFieldMap - Create a field mapping for a ticketing project
- GetAvailableFields - List available fields for ticket field mapping
- DeleteFieldMap - Delete a field map for a ticketing project
- UpdateTicketingFieldMap - Update a field map for a ticketing project
- DeleteProjectConfig - Delete a ticketing project configuration
- GetTicket - Get a ticket
- GetCloudTrailBatch - Get an AWS CloudTrail batch
- UpdateConnection - Update an AWS connection
- GetEmojiAction - Get a Slack emoji action
- DeleteEmojiAction - Delete a Slack emoji action
- ListWorkspaces - List Slack workspaces for a connection
- ListConnections - List Statuspage connections
- ListPages - List StatusPage pages for a connection
- GetProject - Get a ticketing project
- ListTags - List ticket tags
- List - List scheduled maintenance events
- Create - Create a scheduled maintenance event
- Delete - Delete a scheduled maintenance event
- GetMttx - Fetch infrastructure metrics based on custom query
- GetInfrastructure - Get metrics for a specific catalog entry
- ListMeasurementDefinitions - List measurement definitions
- CreateMeasurementDefinition - Create a measurement definition
- GetMeasurementDefinition - Get a measurement definition
- DeleteMeasurementDefinition - Archive a measurement definition
- UpdateMeasurementDefinition - Update a measurement definition
- ListIncidentMetrics - List incident metrics and analytics
- GetMilestoneFunnelMetrics - List milestone funnel metrics
- ListRetrospectives - List retrospective metrics for a date range
- GetTicketFunnel - List ticket funnel metrics
- ListUserInvolvementMetrics - List user involvement metrics
- ListInfrastructureMetrics - List metrics for all services, environments, functionalities, or customers
- GetMeanTime - Get mean time metrics for incidents
- ListSavedSearches - List saved searches
- CreateSavedSearch - Create a saved search
- Delete - Delete an on-call schedule for a team
- ListQuestions - List retrospective questions
- UpdateQuestions - Update retrospective questions
- GetQuestion - Get a retrospective question
- ListReports - List retrospective reports
- CreateReport - Create a retrospective report
- GetReport - Get a retrospective report
- UpdateReport - Update a retrospective report
- UpdateField - Update a retrospective field
- PublishReport - Publish a retrospective report
- ListReportReasons - List contributing factors for a retrospective report
- CreateReason - Create a contributing factor for a retrospective report
- UpdateReportReasonOrder - Update the order of contributing factors in a retrospective report
- DeleteReason - Delete a contributing factor from a retrospective report
- UpdateReason - Update a contributing factor in a retrospective report
- ListAudits - List runbook audits
- List - List runbooks
- Create - Create a runbook
- ListActions - List runbook actions
- ListExecutions - List runbook executions
- CreateExecution - Create a runbook execution
- GetExecution - Get a runbook execution
- UpdateExecutionStep - Update a runbook execution step
- GetExecutionStepScript - Get a runbook execution step script
- UpdateExecutionStepScriptState - Update the script state for a runbook execution step
- UpdateExecutionStepVotes - Update votes for a runbook execution step
- GetStepVoteStatus - Get vote counts for a runbook step
- UpdateExecutionVotes - Vote on a runbook execution
- GetExecutionVoteStatus - Get vote counts for a runbook execution
- ListSelectOptions - List select options for a runbook integration action field
- Get - Get a runbook
- Update - Update a runbook
- Delete - Delete a runbook
- Delete - Terminate a runbook execution
- ListGroups - List teams via SCIM
- Create - Create a team via SCIM
- GetGroup - Get a SCIM group
- UpdateGroup - Update a SCIM group
- DeleteGroup - Delete a SCIM group
- ListUsers - List users via SCIM
- CreateUser - Create a user via SCIM
- GetUser - Get a SCIM user
- ReplaceUser - Replace a SCIM user
- DeleteUser - Delete a SCIM user
- UpdateUser - Update a SCIM user
- CreateDependency - Create a dependency relationship between services
- GetDependency - Get a service dependency
- DeleteDependency - Delete a service dependency
- Update - Update a service dependency
- List - List services
- Create - Create a service
- CreateLinks - Create multiple services and link them to external services
- Get - Get a service
- Delete - Delete a service
- Patch - Update a service
- GetAvailableDownstreamDependencies - List available downstream service dependencies
- ListAvailableUpstreamDependencies - List available upstream service dependencies
- CreateChecklistResponse - Create a checklist response for a service
- ListDependencies - List dependencies for a service
- DeleteLink - Delete a service link
- ListForUser - List services for a user's teams
- ListGroupedMetrics - List grouped signal alert metrics
- GetMttxAnalytics - Get MTTX analytics for signals
- GetAnalyticsTimeseries - List timeseries metrics for signal alerts
- Debug - Debug a signal
- ListEmailTargets - List email targets for signals
- CreateEmailTarget - Create an email target for signals
- GetEmailTarget - Get a signal email target
- DeleteEmailTarget - Delete a signal email target
- UpdateEmailTarget - Update a signal email target
- ListEventSources - List event sources for signals
- GetIngestURL - Get signal ingestion URL
- ListTransposers - List signal transposers
- ListWebhookTargets - List webhook targets for signals
- CreateWebhookTarget - Create a webhook target for signals
- GetWebhookTarget - Get a webhook target
- DeleteWebhookTarget - Delete a webhook target
- UpdateWebhookTarget - Update a webhook target
- ListOnCall - List on-call schedules
- ListEscalationPolicies - List escalation policies for a team
- DeleteEscalationPolicy - Delete an escalation policy for a team
- GetOnCallSchedule - Get an on-call schedule for a team
- UpdateOnCallSchedule - Update an on-call schedule for a team
- ListRules - List signal rules for a team
- CreateRule - Create a signal rule for a team
- GetRule - Get a signal rule
- DeleteRule - Delete a signal rule
- UpdateRule - Update a signal rule
- GetEscalationPolicy - Get an escalation policy for a team
- CreateEmojiAction - Create a Slack emoji action
- UpdateEmojiAction - Update a Slack emoji action
- ListUsergroups - List Slack usergroups
- UpdateConnection - Update a Statuspage connection
- DeleteIncident - Remove a status page from an incident
- CreateSubscription - Create a status page subscription
- DeleteSubscription - Unsubscribe from status page notifications
- List - List status pages
- Create - Create a status page
- Get - Get a status page
- Update - Update a status page
- Delete - Delete a status page
- CreateComponentGroup - Create a component group for a status page
- DeleteComponentGroup - Delete a status page component group
- UpdateComponentGroup - Update a status page component group
- UpdateImage - Upload an image for a status page
- DeleteImage - Delete an image from a status page
- CreateLink - Create a link for a status page
- DeleteLink - Delete a status page link
- UpdateLink - Update a status page link
- ListSubscribers - List status page subscribers
- CreateSubscribers - Add subscribers to a status page
- DeleteSubscribers - Remove subscribers from a status page
- Create - Create a status update template
- Ping - Check API connectivity
- ListChecklistTemplates - List checklist templates
- CreateChecklistTemplate - Create a checklist template
- DeleteChecklistTemplate - Archive a checklist template
- UpdateChecklistTemplate - Update a checklist template
- ListForIncident - List tasks for an incident
- Create - Create a task for an incident
- GetForIncident - Get a task for an incident
- Delete - Delete a task from an incident
- UpdateTask - Update a task for an incident
- ConvertToFollowup - Convert a task to a follow-up
- ListTasks - List task lists
- CreateList - Create a task list
- Get - Get a task list
- Update - Update a task list
- Delete - Delete a task list
- ListSchedules - List schedules
- List - List teams
- Create - Create a team
- Get - Get a team
- Archive - Archive a team
- Update - Update a team
- ListOnCallSchedules - List on-call schedules for a team
- CreateOnCallSchedule - Create an on-call schedule for a team
- GetScheduleShift - Get an on-call shift for a team schedule
- DeleteScheduleShift - Delete an on-call shift from a team schedule
- UpdateScheduleShift - Update an on-call shift in a team schedule
- CreateEscalationPolicy - Create an escalation policy for a team
- UpdateEscalationPolicy - Update an escalation policy for a team
- CreateShift - Create a shift for an on-call schedule
- GetFieldMap - Get a field map for a ticketing project
- UpdateProjectConfig - Update a ticketing project configuration
- Get - Get a ticketing priority
- GetCurrent - Get the currently authenticated user
- List - List users
- Get - Get a user
- List - List webhooks
- Create - Create a webhook
- Get - Get a webhook
- Delete - Delete a webhook
- Update - Update a webhook
- ListDeliveries - List webhook deliveries
- SearchTickets - Search for Zendesk tickets
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply provide a retry.Config
object to the call by using the WithRetries
option:
package main
import (
"context"
"firehydrant"
"firehydrant/retry"
"log"
"models/operations"
)
func main() {
s := firehydrant.New(
firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.AccountSettings.GetAiPreferences(ctx, operations.WithRetries(
retry.Config{
Strategy: "backoff",
Backoff: &retry.BackoffStrategy{
InitialInterval: 1,
MaxInterval: 50,
Exponent: 1.1,
MaxElapsedTime: 100,
},
RetryConnectionErrors: false,
}))
if err != nil {
log.Fatal(err)
}
if res.AIEntitiesPreferencesEntity != nil {
// handle response
}
}
If you'd like to override the default retry strategy for all operations that support retries, you can use the WithRetryConfig
option at SDK initialization:
package main
import (
"context"
"firehydrant"
"firehydrant/retry"
"log"
)
func main() {
s := firehydrant.New(
firehydrant.WithRetryConfig(
retry.Config{
Strategy: "backoff",
Backoff: &retry.BackoffStrategy{
InitialInterval: 1,
MaxInterval: 50,
Exponent: 1.1,
MaxElapsedTime: 100,
},
RetryConnectionErrors: false,
}),
firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.AccountSettings.GetAiPreferences(ctx)
if err != nil {
log.Fatal(err)
}
if res.AIEntitiesPreferencesEntity != nil {
// handle response
}
}
Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both.
By Default, an API error will return sdkerrors.SDKError
. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective Errors tables in SDK docs for more details on possible error types for each operation.
For example, the GetAiPreferences
function may return the following errors:
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.BadRequest | 400, 413, 414, 415, 422, 431, 510 | application/json |
sdkerrors.Unauthorized | 401, 403, 407, 511 | application/json |
sdkerrors.NotFound | 404, 501, 505 | application/json |
sdkerrors.Timeout | 408, 504 | application/json |
sdkerrors.RateLimited | 429 | application/json |
sdkerrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
package main
import (
"context"
"errors"
"firehydrant"
"firehydrant/models/sdkerrors"
"log"
)
func main() {
s := firehydrant.New(
firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.AccountSettings.GetAiPreferences(ctx)
if err != nil {
var e *sdkerrors.BadRequest
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
var e *sdkerrors.Unauthorized
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
var e *sdkerrors.NotFound
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
var e *sdkerrors.Timeout
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
var e *sdkerrors.RateLimited
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
var e *sdkerrors.InternalServerError
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
var e *sdkerrors.SDKError
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
}
}
The default server can also be overridden globally using the WithServerURL(serverURL string)
option when initializing the SDK client instance. For example:
package main
import (
"context"
"firehydrant"
"log"
)
func main() {
s := firehydrant.New(
firehydrant.WithServerURL("https://api.firehydrant.io/"),
firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.AccountSettings.GetAiPreferences(ctx)
if err != nil {
log.Fatal(err)
}
if res.AIEntitiesPreferencesEntity != nil {
// handle response
}
}
The Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface:
type HTTPClient interface {
Do(req *http.Request) (*http.Response, error)
}
The built-in net/http
client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout.
import (
"net/http"
"time"
"github.com/myorg/your-go-sdk"
)
var (
httpClient = &http.Client{Timeout: 30 * time.Second}
sdkClient = sdk.New(sdk.WithClient(httpClient))
)
This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.
This SDK defines the following custom types to assist with marshalling and unmarshalling data.
types.Date
is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02".
d1 := types.NewDate(time.Now()) // returns *types.Date
d2 := types.DateFromTime(time.Now()) // returns types.Date
d3, err := types.NewDateFromString("2019-01-01") // returns *types.Date, error
d4, err := types.DateFromString("2019-01-01") // returns types.Date, error
d5 := types.MustNewDateFromString("2019-01-01") // returns *types.Date and panics on error
d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on error
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.