importer

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package importer converts PagerDuty data into Fluidify Regen entities and persists them to the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImportOpsgeniePolicies

func ImportOpsgeniePolicies(
	repo policyRepoWriter,
	policies []opsgenie.OGEscalationPolicy,
	scheduleNameToID map[string]uuid.UUID,
	emailToName map[string]string,
	force bool,
	report *ImportReport,
) error

ImportOpsgeniePolicies imports all Opsgenie escalation policies into Regen.

func ImportOpsgenieSchedules

func ImportOpsgenieSchedules(
	repo scheduleRepoWriter,
	details []opsgenie.OGScheduleDetail,
	emailToName map[string]string,
	force bool,
	report *ImportReport,
) error

ImportOpsgenieSchedules imports all Opsgenie schedule details into Regen.

func ImportPolicies

func ImportPolicies(
	repo policyRepoWriter,
	details []pagerduty.PDEscalationPolicyDetail,
	scheduleNameToID map[string]uuid.UUID,
	emailToName map[string]string,
	force bool,
	report *ImportReport,
) error

ImportPolicies imports all PagerDuty escalation policy details into Fluidify Regen. scheduleNameToID maps imported schedule names to their new OI UUIDs. emailToName maps PD user email → display name for user_reference targets.

func ImportSchedules

func ImportSchedules(
	repo scheduleRepoWriter,
	details []pagerduty.PDScheduleDetail,
	emailToName map[string]string,
	force bool,
	report *ImportReport,
) error

ImportSchedules imports all PagerDuty schedule details into Fluidify Regen. emailToName is used to resolve user names; force overwrites name conflicts.

Types

type ImportReport

type ImportReport struct {
	ImportedAt time.Time     `json:"imported_at"`
	Summary    ReportSummary `json:"summary"`
	Warnings   []string      `json:"warnings"`
	Errors     []string      `json:"errors"`
}

ImportReport is written to disk after the import completes.

func (*ImportReport) PrintSummary

func (r *ImportReport) PrintSummary()

PrintSummary writes a human-readable summary to stdout.

func (*ImportReport) WriteToFile

func (r *ImportReport) WriteToFile(path string) error

WriteToFile serialises the report as JSON and writes it to path.

type ReportSummary

type ReportSummary struct {
	SchedulesFound    int `json:"schedules_found"`
	SchedulesImported int `json:"schedules_imported"`
	SchedulesSkipped  int `json:"schedules_skipped"`
	LayersImported    int `json:"layers_imported"`
	LayersSkipped     int `json:"layers_skipped"`
	PoliciesFound     int `json:"policies_found"`
	PoliciesImported  int `json:"policies_imported"`
	PoliciesSkipped   int `json:"policies_skipped"`
	TiersImported     int `json:"tiers_imported"`
}

ReportSummary holds counts of imported and skipped entities.

Jump to

Keyboard shortcuts

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