Manage incidents from ring to retro
Developer-friendly & type-safe Go SDK specifically catered to leverage FireHydrant API.
FireHydrant API: The FireHydrant API is based around REST. It uses Bearer token authentication and returns JSON responses. You can use the FireHydrant API to configure integrations, define incidents, and set up webhooks--anything you can do on the FireHydrant UI.
v1
All requests to the FireHydrant API require an Authorization
header with the value set to Bearer {token}
. FireHydrant supports bot tokens to act on behalf of a computer instead of a user's account. This prevents integrations from breaking when people leave your organization or their token is revoked. See the Bot tokens section (below) for more information on this.
An example of a header to authenticate against FireHydrant would look like:
Authorization: Bearer fhb-thisismytoken
To access the FireHydrant API, you must authenticate with a bot token. (You must have owner permissions on your organization to see bot tokens.) Bot users allow you to interact with the FireHydrant API by using token-based authentication. To create bot tokens, log in to your organization and refer to the Bot users page.
Bot tokens enable you to create a bot that has no ties to any user. Normally, all actions associated with an API token are associated with the user who created it. Bot tokens attribute all actions to the bot user itself. This way, all data associated with the token actions can be performed against the FireHydrant API without a user.
Every request to the API is authenticated unless specified otherwise.
Currently, requests made with bot tokens are rate limited on a per-account level. If your account has multiple bot token then the rate limit is shared across all of them. As of February 7th, 2023, the rate limit is at least 50 requests per account every 10 seconds, or 300 requests per minute.
Rate limited responses will be served with a 429
status code and a JSON body of:
{"error": "rate limit exceeded"}
and headers of:
"RateLimit-Limit" -> the maximum number of requests in the rate limit pool
"Retry-After" -> the number of seconds to wait before trying again
API lists are returned as arrays. A paginated entity in FireHydrant will return two top-level keys in the response object: a data key and a pagination key.
The data
key is returned as an array. Each item in the array includes all of the entity data specified in the API endpoint. (The per-page default for the array is 20 items.)
Pagination is the second key (pagination
) returned in the overall response body. It includes medtadata around the current page, total count of items, and options to go to the next and previous page. All of the specifications returned in the pagination object are available as URL parameters. So if you want to specify, for example, going to the second page of a response, you can send a request to the same endpoint but pass the URL parameter page=2.
For example, you might request https://api.firehydrant.io/v1/environments/ to retrieve environments data. The JSON returned contains the above-mentioned data section and pagination section. The data section includes various details about an incident, such as the environment name, description, and when it was created.
{
"data": [
{
"id": "f8125cf4-b3a7-4f88-b5ab-57a60b9ed89b",
"name": "Production - GCP",
"description": "",
"created_at": "2021-02-17T20:02:10.679Z"
},
{
"id": "a69f1f58-af77-4708-802d-7e73c0bf261c",
"name": "Staging",
"description": "",
"created_at": "2021-04-16T13:41:59.418Z"
}
],
"pagination": {
"count": 2,
"page": 1,
"items": 2,
"pages": 1,
"last": 1,
"prev": null,
"next": null
}
}
To request the second page, you'd request the same endpoint with the additional query parameter of page
in the URL:
GET https://api.firehydrant.io/v1/environments?page=2
If you need to modify the number of records coming back from FireHydrant, you can use the per_page
parameter (max is 200):
GET https://api.firehydrant.io/v1/environments?per_page=50
- Base API endpoint
- Current version
- Authentication
- Bot tokens
- How lists are returned
- SDK Installation
- Authentication
- SDK Example Usage
- Available Resources and Operations
- Retries
- Error Handling
- Server Selection
- Custom HTTP Client
- Special Types
- Development
To add the SDK as a dependency to your project:
go get github.com/firehydrant/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"
"firehydrant/models/components"
"log"
)
func main() {
ctx := context.Background()
s := firehydrant.New(
firehydrant.WithSecurity(components.Security{
APIKey: "<YOUR_API_KEY_HERE>",
}),
)
res, err := s.AccountSettings.Ping(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
package main
import (
"context"
"firehydrant"
"firehydrant/models/components"
"log"
)
func main() {
ctx := context.Background()
s := firehydrant.New(
firehydrant.WithSecurity(components.Security{
APIKey: "<YOUR_API_KEY_HERE>",
}),
)
res, err := s.AccountSettings.Ping(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Available methods
- Ping - Check API connectivity
- ListEntitlements - List entitlements
- PingNoauth - Check API connectivity
- GetBootstrap - Get initial application configuration
- GetAiPreferences - Get AI preferences
- UpdateAiPreferences - Update AI preferences
- ListIncidentAlerts - List alerts for an incident
- CreateIncidentAlert - Attach an alert to an incident
- UpdateIncidentAlertPrimary - Set an alert as primary for an incident
- DeleteIncidentAlert - Remove an alert from an incident
- ListAlerts - List alerts
- GetAlert - Get an alert
- ListProcessingLogEntries - List alert processing log entries
- ListAudiences - List audiences
- CreateAudience - Create audience
- GetAudience - Get audience
- ArchiveAudience - Archive audience
- UpdateAudience - Update audience
- RestoreAudience - Restore audience
- GetMemberDefaultAudience - Get default audience
- SetMemberDefaultAudience - Set default audience
- GetAudienceSummary - Get latest summary
- GenerateAudienceSummary - Generate summary
- ListAudienceSummaries - List audience summaries
- ListAuditEvents - List audit events
- GetAuditEvent - Get a single audit event
- ListTeamCallRoutes - List call routes for a team
- CreateTeamCallRoute - Create a call route for a team
- ListCallRoutes - List call routes
- GetCallRoute - Retrieve a call route
- DeleteCallRoute - Delete a call route
- UpdateCallRoute - Update a call route
- ListEnvironments - List environments
- CreateEnvironment - Create an environment
- GetEnvironment - Get an environment
- DeleteEnvironment - Archive an environment
- UpdateEnvironment - Update an environment
- ListServices - List services
- CreateService - Create a service
- CreateServiceLinks - Create multiple services linked to external services
- GetService - Get a service
- DeleteService - Delete a service
- UpdateService - Update a service
- GetServiceDependencies - List dependencies for a service
- ListServiceAvailableUpstreamDependencies - List available upstream service dependencies
- ListServiceAvailableDownstreamDependencies - List available downstream service dependencies
- DeleteServiceLink - Delete a service link
- CreateServiceChecklistResponse - Record a response for a checklist item
- CreateServiceDependency - Create a service dependency
- GetServiceDependency - Get a service dependency
- DeleteServiceDependency - Delete a service dependency
- UpdateServiceDependency - Update a service dependency
- ListFunctionalities - List functionalities
- CreateFunctionality - Create a functionality
- GetFunctionality - Get a functionality
- DeleteFunctionality - Archive a functionality
- UpdateFunctionality - Update a functionality
- ListFunctionalityServices - List services for a functionality
- ListUserOwnedServices - List services owned by a user's teams
- ListInfrastructures - Lists functionality, service and environment objects
- RefreshCatalog - Refresh a service catalog
- IngestCatalogData - Ingest service catalog data
- ListChanges - List changes
- CreateChange - Create a new change entry
- DeleteChange - Archive a change entry
- UpdateChange - Update a change entry
- ListChangeIdentities - List identities for a change entry
- CreateChangeIdentity - Create an identity for a change entry
- DeleteChangeIdentity - Delete an identity from a change entry
- UpdateChangeIdentity - Update an identity for a change entry
- ListChangeEvents - List change events
- CreateChangeEvent - Create a change event
- GetChangeEvent - Get a change event
- DeleteChangeEvent - Delete a change event
- UpdateChangeEvent - Update a change event
- ListChangeTypes - List change types
- ListStatusUpdateTemplates - List status update templates
- CreateStatusUpdateTemplate - Create a status update template
- GetStatusUpdateTemplate - Get a status update template
- DeleteStatusUpdateTemplate - Delete a status update template
- UpdateStatusUpdateTemplate - Update a status update template
- GetVoteStatus - Get votes
- UpdateVote - Update votes
- DeleteCommentReaction - Delete a reaction from a conversation comment
- ListCommentReactions - List reactions for a conversation comment
- CreateCommentReaction - Create a reaction for a conversation comment
- GetComment - Get a conversation comment
- DeleteComment - Archive a conversation comment
- UpdateComment - Update a conversation comment
- ListComments - List comments for a conversation
- CreateComment - Create a conversation comment
- ListIncidents - List incidents
- CreateIncident - Create an incident
- GetIncidentChannel - Get chat channel information for an incident
- CloseIncident - Close an incident
- ResolveIncident - Resolve an incident
- GetIncident - Get an incident
- DeleteIncident - Archive an incident
- UpdateIncident - Update an incident
- UnarchiveIncident - Unarchive an incident
- BulkUpdateIncidentMilestones - Update milestone times
- ListIncidentMilestones - List incident milestones
- ListIncidentChangeEvents - List related changes on an incident
- CreateIncidentChangeEvent - Add a related change to an incident
- UpdateIncidentChangeEvent - Update a change attached to an incident
- ListIncidentStatusPages - List status pages for an incident
- CreateIncidentStatusPage - Add a status page to an incident
- ListIncidentLinks - List links on an incident
- CreateIncidentLink - Add a link to an incident
- UpdateIncidentLink - Update the external incident link
- DeleteIncidentLink - Remove a link from an incident
- UpdateTranscriptAttribution - Update the attribution of a transcript
- ListTranscriptEntries - Lists all of the messages in the incident's transcript
- DeleteTranscriptEntry - Delete a transcript from an incident
- ListIncidentConferenceBridges - Retrieve all conference bridges for an incident
- GetConferenceBridgeTranslation - Retrieve the translations for a specific conference bridge
- ListSimilarIncidents - List similar incidents
- ListIncidentAttachments - List attachments for an incident
- CreateIncidentAttachment - Add an attachment to the incident timeline
- ListIncidentEvents - List events for an incident
- GetIncidentEvent - Get an incident event
- DeleteIncidentEvent - Delete an incident event
- UpdateIncidentEvent - Update an incident event
- UpdateIncidentImpactPut - Update impacts for an incident
- UpdateIncidentImpactPatch - Update impacts for an incident
- ListIncidentImpacts - List impacted infrastructure for an incident
- CreateIncidentImpact - Add impacted infrastructure to an incident
- DeleteIncidentImpact - Remove impacted infrastructure from an incident
- CreateIncidentNote - Add a note to an incident
- UpdateIncidentNote - Update a note
- CreateIncidentChatMessage - Add a chat message to an incident
- DeleteIncidentChatMessage - Delete a chat message from an incident
- UpdateIncidentChatMessage - Update a chat message on an incident
- ListIncidentRoleAssignments - List incident assignees
- CreateIncidentRoleAssignment - Assign a user to an incident
- DeleteIncidentRoleAssignment - Unassign a user from an incident
- CreateIncidentTeamAssignment - Assign a team to an incident
- DeleteIncidentTeamAssignment - Unassign a team from an incident
- GetIncidentUser - Get the current user's incident role
- GetIncidentRelationships - List incident relationships
- ListScheduledMaintenances - List scheduled maintenance events
- CreateScheduledMaintenance - Create a scheduled maintenance event
- GetScheduledMaintenance - Get a scheduled maintenance event
- DeleteScheduledMaintenance - Delete a scheduled maintenance event
- UpdateScheduledMaintenance - Update a scheduled maintenance event
- GetAiIncidentSummaryVoteStatus - Get the current user's vote status for an AI-generated incident summary
- VoteAiIncidentSummary - Vote on an AI-generated incident summary
- ListIncidentRoles - List incident roles
- CreateIncidentRole - Create an incident role
- GetIncidentRole - Get an incident role
- DeleteIncidentRole - Archive an incident role
- UpdateIncidentRole - Update an incident role
- ValidateIncidentTags - Validate incident tags
- ListIncidentTags - List incident tags
- ListIncidentTypes - List incident types
- CreateIncidentType - Create an incident type
- GetIncidentType - Get an incident type
- DeleteIncidentType - Archive an incident type
- UpdateIncidentType - Update an incident type
- ListLifecycleMeasurementDefinitions - List measurement definitions
- CreateLifecycleMeasurementDefinition - Create a measurement definition
- GetLifecycleMeasurementDefinition - Get a measurement definition
- DeleteLifecycleMeasurementDefinition - Archive a measurement definition
- UpdateLifecycleMeasurementDefinition - Update a measurement definition
- ListLifecyclePhases - List phases and milestones
- CreateLifecycleMilestone - Create a milestone
- DeleteLifecycleMilestone - Delete a milestone
- UpdateLifecycleMilestone - Update a milestone
- 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
- UpdateSeverityMatrixCondition - Update a severity matrix condition
- ListSeverityMatrixImpacts - List severity matrix impacts
- CreateSeverityMatrixImpact - Create a severity matrix impact
- DeleteSeverityMatrixImpact - Delete a severity matrix impact
- UpdateSeverityMatrixImpact - Update a severity matrix impact
- DeleteCustomFieldDefinition - Delete a custom field definition
- UpdateCustomFieldDefinition - Update a custom field definition
- ListCustomFieldDefinitions - List custom field definitions
- CreateCustomFieldDefinition - Create a custom field definition
- ListCustomFieldSelectOptions - Get available values for a custom field
- AppendFormDataOnSelectedValueGet - Get data for a form field on select
- GetFormConfiguration - Get a form configuration
- ListIntegrations - List integrations
- GetIntegration - Get an integration
- UpdateFieldMap - Update field mapping
- ListFieldMapAvailableFields - List available fields for field mapping
- ListAuthedProviders - Lists the available and configured integrations
- UpdateAuthedProvider - Get an authed provider
- ListConnections - List integration connections
- CreateConnection - Create a new integration connection
- RefreshConnection - Refresh an integration connection
- UpdateConnection - Update an integration connection
- ListConnectionStatuses - Get integration connection status
- ListConnectionStatusesBySlug - Get an integration connection status
- ListConnectionStatusesBySlugAndID - Get an integration connection status
- ListAwsConnections - List AWS connections
- GetAwsConnection - Get an AWS connection
- UpdateAwsConnection - Update an AWS connection
- ListAwsCloudtrailBatches - List CloudTrail batches
- GetAwsCloudtrailBatch - Get a CloudTrail batch
- UpdateAwsCloudtrailBatch - Update a CloudTrail batch
- ListAwsCloudtrailBatchEvents - List events for an AWS CloudTrail batch
- SearchConfluenceSpaces - List Confluence spaces
- ListSlackWorkspaces - List Slack workspaces
- ListSlackUsergroups - List Slack user groups
- ListSlackEmojiActions - List Slack emoji actions
- CreateSlackEmojiAction - Create a new Slack emoji action
- GetSlackEmojiAction - Get a Slack emoji action
- DeleteSlackEmojiAction - Delete a Slack emoji action
- UpdateSlackEmojiAction - Update a Slack emoji action
- ListStatuspageConnections - List Statuspage connections
- GetStatuspageConnection - Get a Statuspage connection
- DeleteStatuspageConnection - Delete a Statuspage connection
- UpdateStatuspageConnection - Update a Statuspage connection
- ListStatuspageConnectionPages - List StatusPage pages for a connection
- SearchZendeskTickets - Search for Zendesk tickets
- GetZendeskCustomerSupportIssue - Search for Zendesk tickets
- GetMeanTimeReport - Get mean time metrics for incidents
- ListTicketFunnelMetrics - List ticket task and follow up creation and completion metrics
- ListRetrospectiveMetrics - List retrospective metrics
- ListMilestoneFunnelMetrics - List milestone funnel metrics
- ListUserInvolvementMetrics - List user metrics
- ListIncidentMetrics - List incident metrics and analytics
- ListMttxMetrics - Get infrastructure metrics
- ListInfrastructureTypeMetrics - List metrics for a component type
- ListInfrastructureMetrics - Get metrics for a component
- GetSavedSearch - Get a saved search
- DeleteSavedSearch - Delete a saved search
- UpdateSavedSearch - Update a saved search
- ListSavedSearches - List saved searches
- CreateSavedSearch - Create a saved search
- GetSignalsTimeseriesAnalytics - Generate timeseries alert metrics
- GetSignalsGroupedMetrics - Generate grouped alert metrics
- GetSignalsMttxAnalytics - Get MTTX analytics for signals
- ExportSignalsShiftAnalytics - Export on-call hours report
- ShareIncidentRetrospectives - Share an incident's retrospective
- ExportIncidentRetrospectives - Export an incident's retrospective(s)
- ListIncidentRetrospectives - All attached retrospectives for an incident
- CreateIncidentRetrospective - Create a new retrospective on the incident using the template
- UpdateIncidentRetrospective - Update a retrospective on the incident
- CreateIncidentRetrospectiveField - Appends a new incident retrospective field to an incident retrospective
- GetIncidentRetrospectiveField - Get a retrospective field
- UpdateIncidentRetrospectiveField - Update the value on a retrospective field
- CreateIncidentRetrospectiveDynamicInput - Add a new dynamic input field to a retrospective's dynamic input group field
- DeleteIncidentRetrospectiveDynamicInput - Removes a dynamic input from a retrospective's dynamic input group field
- ListRetrospectives - List retrospective reports
- ListPostMortemReports - List retrospective reports
- CreatePostMortemReport - Create a retrospective report
- GetPostMortemReport - Get a retrospective report
- UpdatePostMortemReport - Update a retrospective report
- ListPostMortemReasons - List contributing factors for a retrospective report
- CreatePostMortemReason - Create a contributing factor for a retrospective report
- DeletePostMortemReason - Delete a contributing factor from a retrospective report
- UpdatePostMortemReason - Update a contributing factor in a retrospective report
- ReorderPostMortemReasons - Reorder a contributing factor for a retrospective report
- PublishPostMortemReport - Publish a retrospective report
- UpdatePostMortemField - Update a retrospective field
- ListPostMortemQuestions - List retrospective questions
- UpdatePostMortemQuestions - Update retrospective questions
- GetPostMortemQuestion - Get a retrospective question
- ListRetrospectiveTemplates - List retrospective templates
- CreateRetrospectiveTemplate - Create a retrospective template
- GetRetrospectiveTemplate - Get a retrospective template
- DeleteRetrospectiveTemplate - Delete a retrospective template
- UpdateRetrospectiveTemplate - Update a retrospective template
- ListRunbookActions - List runbook actions
- ListRunbookExecutions - List runbook executions
- CreateRunbookExecution - Create a runbook execution
- GetRunbookExecution - Get a runbook execution
- DeleteRunbookExecution - Terminate a runbook execution
- UpdateRunbookExecutionStep - Update a runbook step execution
- GetRunbookExecutionStepScript - Get a step's bash script
- UpdateRunbookExecutionStepScript - Update a script step's execution status
- GetRunbookActionFieldOptions - List select options for a runbook integration action field
- ListRunbooks - List runbooks
- CreateRunbook - Create a runbook
- GetRunbook - Get a runbook
- UpdateRunbook - Update a runbook
- DeleteRunbook - Delete a runbook
- ListRunbookAudits - List runbook audits
- GetScimGroup - Get a SCIM group
- UpdateScimGroup - Update a SCIM group and assign members
- DeleteScimGroup - Delete a SCIM group
- ListScimGroups - List SCIM groups
- CreateScimGroup - Create a SCIM group and assign members
- GetScimUser - Get a SCIM user
- UpdateScimUser - Update a User from SCIM data
- DeleteScimUser - Delete a User matching SCIM data
- PatchScimUser - Update a User from SCIM data
- ListScimUsers - List SCIM users
- CreateScimUser - Create a User from SCIM data
- ListTeamEscalationPolicies - List escalation policies for a team
- CreateTeamEscalationPolicy - Create an escalation policy for a team
- GetTeamEscalationPolicy - Get an escalation policy for a team
- DeleteTeamEscalationPolicy - Delete an escalation policy for a team
- UpdateTeamEscalationPolicy - Update an escalation policy for a team
- ListTeamOnCallSchedules - List on-call schedules for a team
- CreateTeamOnCallSchedule - Create an on-call schedule for a team
- GetTeamOnCallSchedule - Get an on-call schedule for a team
- DeleteTeamOnCallSchedule - Delete an on-call schedule for a team
- UpdateTeamOnCallSchedule - Update an on-call schedule for a team
- CreateOnCallShift - Create a shift for an on-call schedule
- GetOnCallShift - Get an on-call shift for a team schedule
- DeleteOnCallShift - Delete an on-call shift from a team schedule
- UpdateOnCallShift - Update an on-call shift for a team schedule
- ListTeamSignalRules - List Signals rules
- CreateTeamSignalRule - Create a Signals rule
- GetTeamSignalRule - Get a Signals rule
- DeleteTeamSignalRule - Delete a Signals rule
- UpdateTeamSignalRule - Update a Signals rule
- ListSignalsEventSources - List event sources for Signals
- CreateSignalsEventSource - Create an event source for Signals
- GetSignalsEventSource - Get an event source for Signals
- DeleteSignalsEventSource - Delete an event source for Signals
- ListSignalsAlertGroupingConfigurations - List alert grouping configurations.
- CreateSignalsAlertGroupingConfiguration - Create an alert grouping configuration.
- GetSignalsAlertGroupingConfiguration - Get an alert grouping configuration.
- DeleteSignalsAlertGroupingConfiguration - Delete an alert grouping configuration.
- UpdateSignalsAlertGroupingConfiguration - Update an alert grouping configuration.
- ListSignalsEmailTargets - List email targets for signals
- CreateSignalsEmailTarget - Create an email target for signals
- GetSignalsEmailTarget - Get a signal email target
- DeleteSignalsEmailTarget - Delete a signal email target
- UpdateSignalsEmailTarget - Update an email target
- ListSignalsWebhookTargets - List webhook targets
- CreateSignalsWebhookTarget - Create a webhook target
- GetSignalsWebhookTarget - Get a webhook target
- DeleteSignalsWebhookTarget - Delete a webhook target
- UpdateSignalsWebhookTarget - Update a webhook target
- ListSignalsTransposers - List signal transposers
- GetSignalsIngestURL - Get the signals ingestion URL
- DebugSignalsExpression - Debug Signals expressions
- ListOrganizationOnCallSchedules - List who's on call for the organization
- DeleteIncidentStatusPage - Remove a status page from an incident
- ListNuncConnections - List status pages
- CreateNuncConnection - Create a status page
- ListEmailSubscribers - List status page subscribers
- CreateEmailSubscriber - Add subscribers to a status page
- DeleteEmailSubscriber - Remove subscribers from a status page
- GetNuncConnection - Get a status page
- UpdateNuncConnection - Update a status page
- DeleteNuncConnection - Delete a status page
- DeleteNuncComponentGroup - Delete a status page component group
- UpdateNuncComponentGroup - Update a status page component group
- CreateNuncComponentGroup - Create a component group for a status page
- DeleteNuncLink - Delete a status page link
- UpdateNuncLink - Update a status page link
- CreateNuncLink - Add link to a status page
- UpdateNuncImage - Upload an image for a status page
- DeleteNuncImage - Delete an image from a status page
- DeleteNuncSubscription - Unsubscribe from status page notifications
- CreateNuncSubscription - Create a status page subscription
- CreateIncidentTaskList - Add tasks from a task list to an incident
- ListIncidentTasks - List tasks for an incident
- CreateIncidentTask - Create an incident task
- GetIncidentTask - Get an incident task
- DeleteIncidentTask - Delete an incident task
- UpdateIncidentTask - Update an incident task
- ConvertIncidentTask - Convert a task to a follow-up
- ListTaskLists - List task lists
- CreateTaskList - Create a task list
- GetTaskList - Get a task list
- DeleteTaskList - Delete a task list
- UpdateTaskList - Update a task list
- ListChecklistTemplates - List checklist templates
- CreateChecklistTemplate - Create a checklist template
- GetChecklistTemplate - Get a checklist template
- DeleteChecklistTemplate - Archive a checklist template
- UpdateChecklistTemplate - Update a checklist template
- ListTeams - List teams
- CreateTeam - Create a team
- GetTeam - Get a team
- DeleteTeam - Archive a team
- UpdateTeam - Update a team
- ListSchedules - List schedules
- ListTickets - List tickets
- CreateTicket - Create a ticket
- GetTicket - Get a ticket
- DeleteTicket - Archive a ticket
- UpdateTicket - Update a ticket
- ListTicketingProjects - List ticketing projects
- GetTicketingProject - Get a ticketing project
- GetConfigurationOptions - List configuration options for a ticketing project
- GetOptionsForField - List a field's configuration options for a ticketing project
- ListAvailableTicketingFieldMaps - List available fields for ticket field mapping
- CreateTicketingFieldMap - Create a field mapping for a ticketing project
- GetTicketingFieldMap - Get a field map for a ticketing project
- DeleteTicketingFieldMap - Archive a field map for a ticketing project
- UpdateTicketingFieldMap - Update a field map for a ticketing project
- ListAvailableInboundFieldMaps - List available fields for ticket field mapping
- ListInboundFieldMaps - List inbound field maps for a ticketing project
- CreateInboundFieldMap - Create inbound field map for a ticketing project
- GetInboundFieldMap - Get inbound field map for a ticketing project
- UpdateInboundFieldMap - Update inbound field map for a ticketing project
- DeleteInboundFieldMap - Archive inbound field map for a ticketing project
- CreateTicketingProjectConfig - Create a ticketing project configuration
- GetTicketingProjectConfig - Get configuration for a ticketing project
- DeleteTicketingProjectConfig - Archive a ticketing project configuration
- UpdateTicketingProjectConfig - Update configuration for a ticketing project
- ListTicketingPriorities - List ticketing priorities
- CreateTicketingPriority - Create a ticketing priority
- GetTicketingPriority - Get a ticketing priority
- DeleteTicketingPriority - Delete a ticketing priority
- UpdateTicketingPriority - Update a ticketing priority
- ListTicketTags - List ticket tags
- ListUsers - List users
- GetUser - Get a user
- GetCurrentUser - Get the currently authenticated user
- ListWebhooks - List webhooks
- CreateWebhook - Create a webhook
- ListWebhookDeliveries - List webhook deliveries
- GetWebhook - Get a webhook
- DeleteWebhook - Delete a webhook
- UpdateWebhook - Update a webhook
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/models/components"
"firehydrant/retry"
"log"
"models/operations"
)
func main() {
ctx := context.Background()
s := firehydrant.New(
firehydrant.WithSecurity(components.Security{
APIKey: "<YOUR_API_KEY_HERE>",
}),
)
res, err := s.AccountSettings.Ping(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 != 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/models/components"
"firehydrant/retry"
"log"
)
func main() {
ctx := context.Background()
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(components.Security{
APIKey: "<YOUR_API_KEY_HERE>",
}),
)
res, err := s.AccountSettings.Ping(ctx)
if err != nil {
log.Fatal(err)
}
if res != 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 CreateService
function may return the following errors:
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.ErrorEntity | 400 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
package main
import (
"context"
"errors"
"firehydrant"
"firehydrant/models/components"
"firehydrant/models/sdkerrors"
"log"
)
func main() {
ctx := context.Background()
s := firehydrant.New(
firehydrant.WithSecurity(components.Security{
APIKey: "<YOUR_API_KEY_HERE>",
}),
)
res, err := s.CatalogEntries.CreateService(ctx, components.CreateService{
Name: "<value>",
})
if err != nil {
var e *sdkerrors.ErrorEntity
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 be overridden globally using the WithServerURL(serverURL string)
option when initializing the SDK client instance. For example:
package main
import (
"context"
"firehydrant"
"firehydrant/models/components"
"log"
)
func main() {
ctx := context.Background()
s := firehydrant.New(
firehydrant.WithServerURL("https://api.firehydrant.io/"),
firehydrant.WithSecurity(components.Security{
APIKey: "<YOUR_API_KEY_HERE>",
}),
)
res, err := s.AccountSettings.Ping(ctx)
if err != nil {
log.Fatal(err)
}
if res != 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.