provider

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider() *schema.Provider

Provider returns a terraform provider for the FireHydrant API

Types

type CreatedResources added in v0.14.10

type CreatedResources struct {
	TeamIDs           []string `json:"team_ids"`
	OnCallScheduleIDs []string `json:"on_call_schedule_ids"`
	IncidentRoleIDs   []string `json:"incident_role_ids"`
	ServiceIDs        []string `json:"service_ids"`
}

CreatedResources tracks resources that were created during test initialization These will be cleaned up at the end of the test run

type SharedTestResources added in v0.14.10

type SharedTestResources struct {
	Teams                 map[string]string `json:"teams"`                   // name -> ID
	Users                 map[string]string `json:"users"`                   // email -> ID
	IncidentRoles         map[string]string `json:"incident_roles"`          // name -> ID
	Environments          map[string]string `json:"environments"`            // name -> ID
	Services              map[string]string `json:"services"`                // name -> ID
	Priorities            map[string]string `json:"priorities"`              // name -> ID
	Severities            map[string]string `json:"severities"`              // name -> ID
	OnCallSchedules       map[string]string `json:"on_call_schedules"`       // name -> ID
	EscalationPolicies    map[string]string `json:"escalation_policies"`     // name -> ID
	Functionalities       map[string]string `json:"functionalities"`         // name -> ID
	Roles                 map[string]string `json:"roles"`                   // name -> ID
	Rotations             map[string]string `json:"rotations"`               // name -> ID
	Runbooks              map[string]string `json:"runbooks"`                // name -> ID
	TaskLists             map[string]string `json:"task_lists"`              // name -> ID
	IncidentTypes         map[string]string `json:"incident_types"`          // name -> ID
	SignalRules           map[string]string `json:"signal_rules"`            // name -> ID
	StatusUpdateTemplates map[string]string `json:"status_update_templates"` // name -> ID
	InboundEmails         map[string]string `json:"inbound_emails"`          // name -> ID
	CustomEventSources    map[string]string `json:"custom_event_sources"`    // name -> ID

	// Track which resources are created vs pre-existing
	CreatedResources CreatedResources
}

SharedTestResources holds references to pre-existing production resources that can be reused across tests to avoid creating/destroying common resources

func (*SharedTestResources) DestroyCreatedResources added in v0.14.10

func (r *SharedTestResources) DestroyCreatedResources(ctx context.Context, client *firehydrant.APIClient) error

DestroyCreatedResources cleans up resources that were created during test initialization Called once at the end of test run via TestMain

func (*SharedTestResources) GetEnvironmentID added in v0.14.10

func (r *SharedTestResources) GetEnvironmentID(name string) (string, error)

GetEnvironmentID returns the ID for an environment by name, or error if not found

func (*SharedTestResources) GetEscalationPolicyID added in v0.14.10

func (r *SharedTestResources) GetEscalationPolicyID(name string) (string, error)

GetEscalationPolicyID returns the ID for an escalation policy by name, or error if not found

func (*SharedTestResources) GetIncidentRoleID added in v0.14.10

func (r *SharedTestResources) GetIncidentRoleID(name string) (string, error)

GetIncidentRoleID returns the ID for an incident role by name, or error if not found

func (*SharedTestResources) GetOnCallScheduleID added in v0.14.10

func (r *SharedTestResources) GetOnCallScheduleID(name string) (string, error)

GetOnCallScheduleID returns the ID for an on-call schedule by name, or error if not found

func (*SharedTestResources) GetPriorityID added in v0.14.10

func (r *SharedTestResources) GetPriorityID(name string) (string, error)

GetPriorityID returns the ID for a priority by name, or error if not found

func (*SharedTestResources) GetServiceID added in v0.14.10

func (r *SharedTestResources) GetServiceID(name string) (string, error)

GetServiceID returns the ID for a service by name, or error if not found

func (*SharedTestResources) GetSeverityID added in v0.14.10

func (r *SharedTestResources) GetSeverityID(name string) (string, error)

GetSeverityID returns the ID for a severity by name, or error if not found

func (*SharedTestResources) GetTeamID added in v0.14.10

func (r *SharedTestResources) GetTeamID(name string) (string, error)

GetTeamID returns the ID for a team by name, or error if not found

func (*SharedTestResources) GetUserID added in v0.14.10

func (r *SharedTestResources) GetUserID(email string) (string, error)

GetUserID returns the ID for a user by email, or error if not found

func (*SharedTestResources) InitializeSharedResources added in v0.14.10

func (r *SharedTestResources) InitializeSharedResources(ctx context.Context, client *firehydrant.APIClient) error

InitializeSharedResources creates shared test resources if they don't exist Called once at the start of test run via TestMain

func (*SharedTestResources) LoadFromAPI added in v0.14.10

func (r *SharedTestResources) LoadFromAPI() error

LoadFromAPI discovers shared resources by querying the API for resources with test naming convention

func (*SharedTestResources) LoadFromEnvironment added in v0.14.10

func (r *SharedTestResources) LoadFromEnvironment() error

LoadFromEnvironment loads shared resources from FIREHYDRANT_TEST_RESOURCES JSON environment variable

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL