dummy

package
v1.0.147 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DummyCreatedAt = time.Date(2022, time.December, 31, 23, 59, 0, 0, time.UTC)

	DummyYearOldDate = time.Now().AddDate(-1, 0, 0)
)
View Source
var AllDummyAgents = []models.Agent{
	GCPAgent,
}

Order is important since ParentIDs refer to previous components

View Source
var AllDummyPeople = []models.Person{JohnDoe, JohnWick}
View Source
var AllDummyTopologies = []models.Topology{
	LogisticsTopology,
}
View Source
var BackendTeam = models.Team{
	ID:        uuid.New(),
	Name:      "Backend",
	Icon:      "backend",
	CreatedBy: JohnDoe.ID,
	CreatedAt: time.Now(),
	UpdatedAt: time.Now(),
}
View Source
var CartAPICanaryAgent = models.Canary{
	ID:        uuid.MustParse("6dc9d6dd-0b55-4801-837c-352d3abf9b70"),
	AgentID:   GCPAgent.ID,
	Name:      "dummy-cart-api-canary",
	Namespace: "cart",
	Spec:      []byte("{}"),
	CreatedAt: DummyCreatedAt,
}
View Source
var CartAPIHeathCheckAgent = models.Check{
	ID:       uuid.MustParse("eed7bd6e-529b-4693-aca9-43977bcc5ff1"),
	AgentID:  GCPAgent.ID,
	CanaryID: CartAPICanaryAgent.ID,
	Name:     "cart-api-health-check",
	Type:     "http",
	Status:   models.CheckHealthStatus(types.ComponentStatusHealthy),
}
View Source
var ClusterComponent = models.Component{
	ID:         uuid.MustParse("018681fe-8156-4b91-d178-caf8b3c2818c"),
	Name:       "cluster",
	ExternalId: "dummy/cluster",
	Type:       "KubernetesCluster",
	Status:     types.ComponentStatusHealthy,
	CreatedAt:  DummyCreatedAt,
}
View Source
var EC2InstanceA = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassVirtualMachine,
}
View Source
var EC2InstanceB = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassVirtualMachine,
}
View Source
var EC2InstanceBAnalysis = models.ConfigAnalysis{
	ID:            uuid.New(),
	ConfigID:      EC2InstanceB.ID,
	AnalysisType:  models.AnalysisTypeSecurity,
	Severity:      "critical",
	Message:       "SSH key not rotated",
	FirstObserved: &currentTime,
	Status:        models.AnalysisStatusOpen,
}
View Source
var EC2InstanceBNodeBRelationship = models.ConfigComponentRelationship{
	ConfigID:    EC2InstanceB.ID,
	ComponentID: NodeB.ID,
}
View Source
var EKSCluster = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassCluster,
}
View Source
var EKSClusterClusterComponentRelationship = models.ConfigComponentRelationship{
	ConfigID:    EKSCluster.ID,
	ComponentID: ClusterComponent.ID,
}
View Source
var EKSClusterCreateChange = models.ConfigChange{
	ID:               uuid.New().String(),
	ConfigID:         EKSCluster.ID.String(),
	ChangeType:       "CREATE",
	ExternalChangeId: utils.RandomString(10),
	CreatedAt:        &DummyYearOldDate,
}
View Source
var EKSClusterDeleteChange = models.ConfigChange{
	ID:               uuid.New().String(),
	ConfigID:         EKSCluster.ID.String(),
	ChangeType:       "DELETE",
	ExternalChangeId: utils.RandomString(10),
}
View Source
var EKSClusterUpdateChange = models.ConfigChange{
	ID:               uuid.New().String(),
	ConfigID:         EKSCluster.ID.String(),
	ChangeType:       "UPDATE",
	ExternalChangeId: utils.RandomString(10),
}
View Source
var FirstComment = models.Comment{
	ID:         uuid.New(),
	CreatedBy:  JohnWick.ID,
	Comment:    "This is a comment",
	IncidentID: LogisticsAPIDownIncident.ID,
	CreatedAt:  time.Now(),
	UpdatedAt:  time.Now(),
}
View Source
var FrontendTeam = models.Team{
	ID:        uuid.New(),
	Name:      "Frontend",
	Icon:      "frontend",
	CreatedBy: JohnDoe.ID,
	CreatedAt: time.Now(),
	UpdatedAt: time.Now(),
}
View Source
var GCPAgent = models.Agent{
	ID:   uuid.MustParse("ebd4cbf7-267e-48f9-a050-eca12e535ce1"),
	Name: "GCP",
}
View Source
var GitHubIssueResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: LogisticsAPIDownIncident.ID,
	Type:       "GithubIssue",
	PersonID:   &JohnDoe.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  time.Now(),
	UpdatedAt:  time.Now(),
}
View Source
var JiraResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: LogisticsAPIDownIncident.ID,
	Type:       "Jira",
	PersonID:   &JohnWick.ID,
	CreatedBy:  JohnWick.ID,
	CreatedAt:  time.Now(),
	UpdatedAt:  time.Now(),
}
View Source
var JohnDoe = models.Person{
	ID:   uuid.MustParse("01653e30-39a6-482a-8a9c-2bb8debaf440"),
	Name: "John Doe",
}
View Source
var JohnWick = models.Person{
	ID:   uuid.MustParse("3b6e2e89-b7ab-4751-a2d1-1e205fa478f6"),
	Name: "John Wick",
}
View Source
var KubernetesCluster = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassCluster,
}
View Source
var KubernetesClusterClusterComponentRelationship = models.ConfigComponentRelationship{
	ConfigID:    KubernetesCluster.ID,
	ComponentID: ClusterComponent.ID,
}
View Source
var KubernetesNodeA = models.ConfigItem{
	ID:           uuid.New(),
	ConfigClass:  models.ConfigClassNode,
	CostTotal30d: 1,
}
View Source
var KubernetesNodeAChange = models.ConfigChange{
	ID:               uuid.New().String(),
	ConfigID:         KubernetesNodeA.ID.String(),
	ChangeType:       "CREATE",
	ExternalChangeId: utils.RandomString(10),
}
View Source
var KubernetesNodeB = models.ConfigItem{
	ID:           uuid.New(),
	ConfigClass:  models.ConfigClassNode,
	CostTotal30d: 1.5,
}
View Source
var Logistics = models.Component{
	ID:         uuid.MustParse("018681fc-e54f-bd4f-42be-068a9a69eeb5"),
	Name:       "logistics",
	Type:       "Entity",
	ExternalId: "dummy/logistics",
	Labels:     types.JSONStringMap{"telemetry": "enabled"},
	Owner:      "logistics-team",
	CreatedAt:  DummyCreatedAt,
	Status:     types.ComponentStatusHealthy,
}
View Source
var LogisticsAPI = models.Component{
	ID:         uuid.MustParse("018681fd-5770-336f-227c-259435D7fc6b"),
	Name:       "logistics-api",
	ExternalId: "dummy/logistics-api",
	Type:       "Application",
	Status:     types.ComponentStatusHealthy,
	Labels:     types.JSONStringMap{"telemetry": "enabled"},
	Owner:      "logistics-team",
	ParentId:   &Logistics.ID,
	Path:       Logistics.ID.String(),
	CreatedAt:  DummyCreatedAt,
}
View Source
var LogisticsAPICanary = models.Canary{
	ID:        uuid.MustParse("0186b7a5-a2a4-86fd-c326-3a2104a2777f"),
	Name:      "dummy-logistics-api-canary",
	Namespace: "logistics",
	Spec:      []byte("{}"),
	CreatedAt: DummyCreatedAt,
}
View Source
var LogisticsAPIDeployment = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassDeployment,
}
View Source
var LogisticsAPIDownHypothesis = models.Hypothesis{
	ID:         uuid.New(),
	IncidentID: LogisticsAPIDownIncident.ID,
	Title:      "Logistics DB database error hypothesis",
	CreatedBy:  JohnDoe.ID,
	Type:       "solution",
	Status:     "possible",
}
View Source
var LogisticsAPIDownIncident = models.Incident{
	ID:          uuid.MustParse("7c05a739-8a1c-4999-85f7-d93d03f32044"),
	Title:       "Logistics API is down",
	CreatedBy:   JohnDoe.ID,
	Type:        models.IncidentTypeAvailability,
	Status:      models.IncidentStatusOpen,
	Severity:    "Blocker",
	CommanderID: &JohnDoe.ID,
}
View Source
var LogisticsAPIHealthHTTPCheck = models.Check{
	ID:       uuid.MustParse("0186b7a4-0593-73e9-7e3d-5b3446336c1d"),
	CanaryID: LogisticsAPICanary.ID,
	Name:     "logistics-api-health-check",
	Type:     "http",
	Status:   "healthy",
}
View Source
var LogisticsAPIHealthHTTPCheckComponentRelationship = models.CheckComponentRelationship{
	ComponentID: LogisticsAPI.ID,
	CheckID:     LogisticsAPIHealthHTTPCheck.ID,
	CanaryID:    LogisticsAPIHealthHTTPCheck.CanaryID,
}
View Source
var LogisticsAPIHealthHTTPCheckStatus1 = models.CheckStatus{
	CheckID:   LogisticsAPIHealthHTTPCheck.ID,
	Duration:  100,
	Status:    true,
	CreatedAt: t1,
	Time:      t1.Format("2006-01-02 15:04:05"),
}
View Source
var LogisticsAPIHealthHTTPCheckStatus2 = models.CheckStatus{
	CheckID:   LogisticsAPIHealthHTTPCheck.ID,
	Duration:  100,
	Status:    true,
	CreatedAt: t2,
	Time:      t2.Format("2006-01-02 15:04:05"),
}
View Source
var LogisticsAPIHealthHTTPCheckStatus3 = models.CheckStatus{
	CheckID:   LogisticsAPIHealthHTTPCheck.ID,
	Duration:  100,
	Status:    true,
	CreatedAt: t3,
	Time:      t3.Format("2006-01-02 15:04:05"),
}
View Source
var LogisticsAPIHomeHTTPCheck = models.Check{
	ID:       uuid.MustParse("0186b7a4-625a-6a38-a9a7-e5e6b44ffec3"),
	CanaryID: LogisticsAPICanary.ID,
	Name:     "logistics-api-home-check",
	Type:     "http",
	Status:   "healthy",
}
View Source
var LogisticsAPIHomeHTTPCheckComponentRelationship = models.CheckComponentRelationship{
	ComponentID: LogisticsAPI.ID,
	CheckID:     LogisticsAPIHomeHTTPCheck.ID,
	CanaryID:    LogisticsAPIHomeHTTPCheck.CanaryID,
}
View Source
var LogisticsAPIHomeHTTPCheckStatus1 = models.CheckStatus{
	CheckID:   LogisticsAPIHomeHTTPCheck.ID,
	Duration:  100,
	Status:    true,
	CreatedAt: t1,
	Time:      t3.Format("2006-01-02 15:04:05"),
}
View Source
var LogisticsAPIPod = models.Component{
	ID:         uuid.MustParse("018681ff-80ed-d10d-21ef-c74f152b085b"),
	Name:       "logistics-api-574dc95b5d-mp64w",
	ExternalId: "dummy/logistics-api-574dc95b5d-mp64w",
	Type:       "KubernetesPod",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &PodsComponent.ID,
	CreatedAt:  DummyCreatedAt,
}
View Source
var LogisticsAPIPodNodeAComponentRelationship = models.ComponentRelationship{
	ComponentID:    LogisticsAPIPod.ID,
	RelationshipID: NodeA.ID,
}
View Source
var LogisticsDB = models.Component{
	ID:           uuid.MustParse("018681fe-4529-c50f-26fd-530fa9c57319"),
	Name:         "logistics-db",
	ExternalId:   "dummy/logistics-db",
	Type:         "Database",
	Status:       types.ComponentStatusUnhealthy,
	StatusReason: "database not accepting connections",
	ParentId:     &LogisticsAPI.ID,
	Path:         Logistics.ID.String() + "." + LogisticsAPI.ID.String(),
	CreatedAt:    DummyCreatedAt,
}
View Source
var LogisticsDBCanary = models.Canary{
	ID:        uuid.MustParse("0186b7a5-f246-3628-0d68-30bffc13244d"),
	Name:      "dummy-logistics-db-canary",
	Namespace: "logistics",
	Spec:      []byte("{}"),
	CreatedAt: DummyCreatedAt,
}
View Source
var LogisticsDBCheck = models.Check{
	ID:       uuid.MustParse("0186b7a4-9338-7142-1b10-25dc49030218"),
	CanaryID: LogisticsDBCanary.ID,
	Name:     "logistics-db-check",
	Type:     "postgres",
	Status:   "unhealthy",
}
View Source
var LogisticsDBCheckComponentRelationship = models.CheckComponentRelationship{
	ComponentID: LogisticsDB.ID,
	CheckID:     LogisticsDBCheck.ID,
	CanaryID:    LogisticsDBCheck.CanaryID,
}
View Source
var LogisticsDBCheckStatus1 = models.CheckStatus{
	CheckID:   LogisticsDBCheck.ID,
	Duration:  50,
	Status:    false,
	CreatedAt: t1,
	Time:      t1.Format("2006-01-02 15:04:05"),
}
View Source
var LogisticsDBErrorEvidence = models.Evidence{
	ID:           uuid.New(),
	HypothesisID: LogisticsAPIDownHypothesis.ID,
	ComponentID:  &LogisticsDB.ID,
	CreatedBy:    JohnDoe.ID,
	Description:  "Logisctics DB attached component",
	Type:         "component",
}
View Source
var LogisticsDBRDS = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassDatabase,
}
View Source
var LogisticsDBRDSAnalysis = models.ConfigAnalysis{
	ID:            uuid.New(),
	ConfigID:      LogisticsDBRDS.ID,
	AnalysisType:  models.AnalysisTypeSecurity,
	Severity:      "critical",
	Message:       "Port exposed to public",
	FirstObserved: &currentTime,
	Status:        models.AnalysisStatusOpen,
}
View Source
var LogisticsDBRDSLogisticsDBComponentRelationship = models.ConfigComponentRelationship{
	ConfigID:    LogisticsDBRDS.ID,
	ComponentID: LogisticsDB.ID,
}
View Source
var LogisticsTopology = models.Topology{
	ID:        uuid.MustParse("df39086e-506b-4ad9-9af7-baf5275c382b"),
	Name:      "logistics",
	Namespace: "default",
}
View Source
var LogisticsUI = models.Component{
	ID:         uuid.MustParse("018681fd-c1ff-16ee-dff0-8c8796e4263e"),
	Name:       "logistics-ui",
	Type:       "Application",
	ExternalId: "dummy/logistics-ui",
	Status:     types.ComponentStatusHealthy,
	Owner:      "logistics-team",
	ParentId:   &Logistics.ID,
	Path:       Logistics.ID.String(),
	CreatedAt:  DummyCreatedAt,
}
View Source
var LogisticsUIDeployment = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassDeployment,
}
View Source
var LogisticsUIPod = models.Component{
	ID:         uuid.MustParse("018681ff-b6c1-a14d-2fd4-8c7dac94cddd"),
	Name:       "logistics-ui-676b85b87c-tjjcp",
	Type:       "KubernetesPod",
	ExternalId: "dummy/logistics-ui-676b85b87c-tjjcp",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &PodsComponent.ID,
	CreatedAt:  DummyCreatedAt,
}
View Source
var LogisticsUIPodNodeAComponentRelationship = models.ComponentRelationship{
	ComponentID:    LogisticsUIPod.ID,
	RelationshipID: NodeA.ID,
}
View Source
var LogisticsWorker = models.Component{
	ID:         uuid.MustParse("018681fe-010a-6647-74ad-58b3a136dfe4"),
	Name:       "logistics-worker",
	ExternalId: "dummy/logistics-worker",
	Type:       "Application",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &LogisticsAPI.ID,
	Path:       Logistics.ID.String() + "." + LogisticsAPI.ID.String(),
	CreatedAt:  DummyCreatedAt,
}
View Source
var LogisticsWorkerDeployment = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassDeployment,
}
View Source
var LogisticsWorkerPod = models.Component{
	ID:         uuid.MustParse("018681ff-e578-a926-e366-d2dc0646eafa"),
	Name:       "logistics-worker-79cb67d8f5-lr66n",
	ExternalId: "dummy/logistics-worker-79cb67d8f5-lr66n",
	Type:       "KubernetesPod",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &PodsComponent.ID,
	CreatedAt:  DummyCreatedAt,
}
View Source
var LogisticsWorkerPodNodeBComponentRelationship = models.ComponentRelationship{
	ComponentID:    LogisticsWorkerPod.ID,
	RelationshipID: NodeB.ID,
}
View Source
var MsPlannerResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: UIDownIncident.ID,
	Type:       "MSPlanner",
	PersonID:   &JohnWick.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  time.Now(),
	UpdatedAt:  time.Now(),
}
View Source
var NodeA = models.Component{
	ID:         uuid.MustParse("018681fe-f5aa-37e9-83f7-47b5b0232d5e"),
	Name:       "node-a",
	ExternalId: "dummy/node-a",
	Type:       "KubernetesNode",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &NodesComponent.ID,
	CreatedAt:  DummyCreatedAt,
}
View Source
var NodeB = models.Component{
	ID:         uuid.MustParse("018681ff-227e-4d71-b38e-0693cc862213"),
	Name:       "node-b",
	ExternalId: "dummy/node-b",
	Type:       "KubernetesNode",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &NodesComponent.ID,
	CreatedAt:  DummyCreatedAt,
}
View Source
var NodesComponent = models.Component{
	ID:         uuid.MustParse("018681fe-b27e-7627-72c2-ad18e93f72f4"),
	Name:       "Nodes",
	ExternalId: "dummy/nodes",
	Type:       "KubernetesNodes",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &ClusterComponent.ID,
	CreatedAt:  DummyCreatedAt,
}
View Source
var PaymentsAPI = models.Component{
	ID:         uuid.MustParse("4643e4de-6215-4c71-9600-9cf69b2cbbee"),
	AgentID:    GCPAgent.ID,
	Name:       "payments-api",
	ExternalId: "dummy/payments-api",
	Type:       "Application",
	CreatedAt:  DummyCreatedAt,
	Status:     types.ComponentStatusHealthy,
}
View Source
var PodsComponent = models.Component{
	ID:         uuid.MustParse("018681ff-559f-7183-19d1-7d898b4e1413"),
	Name:       "Pods",
	ExternalId: "dummy/pods",
	Type:       "KubernetesPods",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &ClusterComponent.ID,
	CreatedAt:  DummyCreatedAt,
}
View Source
var SecondComment = models.Comment{
	ID:         uuid.New(),
	CreatedBy:  JohnDoe.ID,
	Comment:    "A comment by John Doe",
	IncidentID: LogisticsAPIDownIncident.ID,
	CreatedAt:  time.Now(),
	UpdatedAt:  time.Now(),
}
View Source
var SlackResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: UIDownIncident.ID,
	Type:       "Slack",
	TeamID:     &BackendTeam.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  time.Now(),
	UpdatedAt:  time.Now(),
}
View Source
var TelegramResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: UIDownIncident.ID,
	Type:       "Telegram",
	PersonID:   &JohnDoe.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  time.Now(),
	UpdatedAt:  time.Now(),
}
View Source
var ThirdComment = models.Comment{
	ID:         uuid.New(),
	CreatedBy:  JohnDoe.ID,
	Comment:    "Another comment by John Doe",
	IncidentID: LogisticsAPIDownIncident.ID,
	CreatedAt:  time.Now(),
	UpdatedAt:  time.Now(),
}
View Source
var UIDownIncident = models.Incident{
	ID:          uuid.MustParse("0c00b8a6-5bf8-42a4-98fe-2d39ddcb67cb"),
	Title:       "UI is down",
	CreatedBy:   JohnDoe.ID,
	Type:        models.IncidentTypeAvailability,
	Status:      models.IncidentStatusOpen,
	Severity:    "Blocker",
	CommanderID: &JohnWick.ID,
}

Functions

func DeleteDummyModelsFromDB added in v1.0.33

func DeleteDummyModelsFromDB(gormDB *gorm.DB) error

func PopulateDBWithDummyModels

func PopulateDBWithDummyModels(gormDB *gorm.DB) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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