dummy

package
v1.0.968 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 13 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)
	DummyCreatedAtPlus1Year = time.Date(2023, time.December, 31, 23, 59, 0, 0, time.UTC)

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

Order is important since ParentIDs refer to previous components

View Source
var AllDummyNotifications = []models.Notification{NoMatchNotification}
View Source
var AllDummyPeople = []models.Person{JohnDoe, JohnWick}
View Source
var AllDummyPlaybooks = []models.Playbook{EchoConfig}
View Source
var AllDummyTeams = []models.Team{BackendTeam, FrontendTeam}
View Source
var AllDummyTopologies = []models.Topology{
	LogisticsTopology,
}
View Source
var AzureConfigScraper = models.ConfigScraper{
	ID:     uuid.New(),
	Name:   "Azure scraper",
	Source: "ConfigFile",
	Spec:   "{}",
}
View Source
var BackendTeam = models.Team{
	ID:        uuid.New(),
	Name:      "Backend",
	Icon:      "backend",
	CreatedBy: JohnDoe.ID,
	CreatedAt: CurrentTime,
	UpdatedAt: CurrentTime,
}
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,
	Tooltip:    "Kubernetes Cluster",
	Icon:       "icon-cluster",
}
View Source
var ClusterNodeARelationship = models.ConfigRelationship{
	ConfigID:  KubernetesCluster.ID.String(),
	RelatedID: KubernetesNodeA.ID.String(),
	Relation:  "ClusterNode",
}
View Source
var ClusterNodeBRelationship = models.ConfigRelationship{
	ConfigID:  KubernetesCluster.ID.String(),
	RelatedID: KubernetesNodeB.ID.String(),
	Relation:  "ClusterNode",
}
View Source
var CurrentTime = time.Now()
View Source
var DeletedCheck, DeletedCheck1h, DeletedCheckOld models.Check
View Source
var EC2InstanceA = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassVirtualMachine,
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("EC2::Instance"),
	Tags: types.JSONStringMap{
		"account": "flanksource",
	},
	Labels: lo.ToPtr(types.JSONStringMap{
		"account":     "flanksource",
		"environment": "testing",
		"app":         "backend",
	}),
}
View Source
var EC2InstanceB = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassVirtualMachine,
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("EC2::Instance"),
	Tags: types.JSONStringMap{
		"account": "flanksource",
	},
	Labels: lo.ToPtr(types.JSONStringMap{
		"account":     "flanksource",
		"environment": "production",
		"app":         "frontend",
	}),
}
View Source
var EC2InstanceBNodeBRelationship = models.ConfigComponentRelationship{
	ConfigID:    EC2InstanceB.ID,
	ComponentID: NodeB.ID,
}
View Source
var EKSCluster = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("Production EKS"),
	ConfigClass: models.ConfigClassCluster,
	Health:      lo.ToPtr(models.HealthUnknown),
	Type:        lo.ToPtr("EKS::Cluster"),
	Tags: types.JSONStringMap{
		"cluster": "aws",
		"account": "flanksource",
	},
	Labels: lo.ToPtr(types.JSONStringMap{
		"account":     "flanksource",
		"cluster":     "aws",
		"environment": "production",
		"telemetry":   "enabled",
		"eks_version": "1.27",
	}),
}
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",
	CreatedAt:     &DummyYearOldDate,
	Severity:      models.SeverityMedium,
	Source:        "CloudTrail",
	Summary:       "EKS cluster created",
	Count:         1,
	FirstObserved: &DummyYearOldDate,
}
View Source
var EKSClusterDeleteChange = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      EKSCluster.ID.String(),
	ChangeType:    "DELETE",
	CreatedAt:     &DummyNow,
	Severity:      models.SeverityHigh,
	Source:        "CloudTrail",
	Summary:       "EKS cluster deleted",
	Count:         1,
	FirstObserved: &DummyNow,
}
View Source
var EKSClusterUpdateChange = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      EKSCluster.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 24)),
	Severity:      models.SeverityLow,
	Source:        "CloudTrail",
	Summary:       "EKS cluster configuration updated",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 24)),
}
View Source
var EchoConfig = models.Playbook{
	ID:          uuid.MustParse("07ffd27a-b33f-4ee6-80d6-b83430a4a16e"),
	Name:        "echo-config",
	Namespace:   "default",
	Title:       "Echo config",
	Description: "echos the config spec",
	Source:      models.SourceUI,
	Category:    "debug",
	Tags: map[string]string{
		"category": "debug",
	},
	Spec: []byte("{}"),
}
View Source
var FirstComment = models.Comment{
	ID:         uuid.New(),
	CreatedBy:  JohnWick.ID,
	Comment:    "This is a comment",
	IncidentID: LogisticsAPIDownIncident.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var FluxComponent = models.Component{
	ID:         uuid.MustParse("018cb576-11e3-a43a-75fd-3cbf5c8c804a"),
	Name:       "flux",
	ExternalId: "dummy/flux",
	Type:       "Flux",
	CreatedAt:  DummyCreatedAtPlus1Year,
	Labels:     types.JSONStringMap{"fluxcd.io/name": "flux"},
	Status:     types.ComponentStatusHealthy,
}
View Source
var FluxKustomizeFluxComponentRelationship = models.ComponentRelationship{
	ComponentID:    FluxComponent.ID,
	RelationshipID: KustomizeFluxComponent.ID,
}

Create a cyclic loop

View Source
var FrontendTeam = models.Team{
	ID:        uuid.New(),
	Name:      "Frontend",
	Icon:      "frontend",
	CreatedBy: JohnDoe.ID,
	CreatedAt: CurrentTime,
	UpdatedAt: CurrentTime,
}
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:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var GitRepository models.ConfigItem
View Source
var JiraResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: LogisticsAPIDownIncident.ID,
	Type:       "Jira",
	PersonID:   &JohnWick.ID,
	CreatedBy:  JohnWick.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var JobHistoryCanaryFailure = models.JobHistory{
	ID:           uuid.MustParse("018f9b10-ecb8-75c1-fefa-9d589fb99c65"),
	Name:         "Canary1",
	ResourceType: "canary",
	Status:       models.StatusFailed,
}
View Source
var JobHistoryCanarySuccess = models.JobHistory{
	ID:           uuid.MustParse("018f9b11-7639-c442-4b62-92fe7fdd4f5c"),
	Name:         "Canary1",
	ResourceType: "canary",
	Status:       models.StatusSuccess,
}
View Source
var JobHistoryCanaryWarning = models.JobHistory{
	ID:           uuid.MustParse("018f9b11-188c-4d71-c826-e356b535ed96"),
	Name:         "Canary1",
	ResourceType: "canary",
	Status:       models.StatusWarning,
}
View Source
var JobHistoryTopologySuccess = models.JobHistory{
	ID:           uuid.MustParse("018f9b11-40f7-e43e-cef5-f9441d77ce5b"),
	Name:         "Topology1",
	ResourceType: "topology",
	Status:       models.StatusSuccess,
}
View Source
var JohnDoe = models.Person{
	ID:    uuid.MustParse("01653e30-39a6-482a-8a9c-2bb8debaf440"),
	Name:  "John Doe",
	Email: "john@doe.com",
}
View Source
var JohnWick = models.Person{
	ID:    uuid.MustParse("3b6e2e89-b7ab-4751-a2d1-1e205fa478f6"),
	Name:  "John Wick",
	Email: "john@wick.com",
}
View Source
var KubeScrapeConfig = models.ConfigScraper{
	ID:        uuid.New(),
	Name:      "kubernetes-scraper",
	Namespace: "default",
	Source:    models.SourceUI,
	Spec: `{
    "kubernetes": [
      {
        "clusterName": "kubernetes",
        "kubeconfig": {
          "value": "testdata/my-kube-config.yaml"
        }
      }
    ]
  }`,
}
View Source
var KubernetesCluster = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassCluster,
	Type:        lo.ToPtr("Kubernetes::Cluster"),
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	Health:      lo.ToPtr(models.HealthUnknown),
	Tags: types.JSONStringMap{
		"cluster": "demo",
		"account": "flanksource",
	},
	Labels: lo.ToPtr(types.JSONStringMap{
		"account":     "flanksource",
		"cluster":     "demo",
		"environment": "development",
		"telemetry":   "enabled",
	}),
}
View Source
var KubernetesClusterClusterComponentRelationship = models.ConfigComponentRelationship{
	ConfigID:    KubernetesCluster.ID,
	ComponentID: ClusterComponent.ID,
}
View Source
var KubernetesNodeA = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("node-a"),
	ConfigClass: models.ConfigClassNode,
	Config:      lo.ToPtr(`{"apiVersion":"v1", "kind":"Node", "metadata": {"name": "node-a"}}`),
	Type:        lo.ToPtr("Kubernetes::Node"),
	CreatedAt:   DummyCreatedAt.Add(time.Hour * 24),
	Status:      lo.ToPtr("healthy"),
	Tags: types.JSONStringMap{
		"cluster": "aws",
		"account": "flanksource",
		"region":  "us-east-1",
	},
	Health: lo.ToPtr(models.HealthHealthy),
	Labels: lo.ToPtr(types.JSONStringMap{
		"cluster": "aws",
		"account": "flanksource",
		"role":    "worker",
		"region":  "us-east-1",
	}),
	Properties: &types.Properties{
		{Name: "memory", Value: lo.ToPtr(int64(64))},
		{Name: "region", Text: "us-east-1"},
	},
	CostTotal30d: 50,
}
View Source
var KubernetesNodeAChange = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      KubernetesNodeA.ID.String(),
	ChangeType:    "CREATE",
	CreatedAt:     &DummyYearOldDate,
	Severity:      models.SeverityInfo,
	Source:        "Kubernetes",
	Summary:       "Kubernetes node created",
	Count:         1,
	FirstObserved: &DummyYearOldDate,
}
View Source
var KubernetesNodeAKSPool1 = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("aks-pool-1"),
	ConfigClass: models.ConfigClassNode,
	Type:        lo.ToPtr("Kubernetes::Node"),
	CreatedAt:   DummyCreatedAt,
	Status:      lo.ToPtr("healthy"),
	Config:      lo.ToPtr(`{"apiVersion":"v1", "kind":"Node", "metadata": {"name": "aks-pool-1"}}`),
	Tags: types.JSONStringMap{
		"cluster":      "demo",
		"subscription": "018fbd67-bb86-90e1-07c9-243eedc73892",
	},
	Health: lo.ToPtr(models.HealthHealthy),
	Labels: lo.ToPtr(types.JSONStringMap{
		"cluster":      "demo",
		"subscription": "018fbd67-bb86-90e1-07c9-243eedc73892",
	}),
	Properties: &types.Properties{
		{Name: "memory", Value: lo.ToPtr(int64(64))},
	},
	CostTotal30d: 100,
}
View Source
var KubernetesNodeB = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("node-b"),
	Config:      lo.ToPtr(`{"apiVersion":"v1", "kind":"Node", "metadata": {"name": "node-b"}}`),
	ConfigClass: models.ConfigClassNode,
	Type:        lo.ToPtr("Kubernetes::Node"),
	CreatedAt:   DummyCreatedAt.Add(time.Hour * 24 * 2),
	Status:      lo.ToPtr("healthy"),
	Tags: types.JSONStringMap{
		"cluster": "aws",
		"account": "flanksource",
	},
	Health: lo.ToPtr(models.HealthHealthy),
	Labels: lo.ToPtr(types.JSONStringMap{
		"cluster":        "aws",
		"account":        "flanksource",
		"role":           "worker",
		"region":         "us-west-2",
		"storageprofile": "managed",
	}),
	Properties: &types.Properties{
		{Name: "memory", Value: lo.ToPtr(int64(32))},
		{Name: "region", Text: "us-west-2"},
		{Name: "os", Text: "linux"},
	},
	CostTotal30d: 80,
}
View Source
var Kustomization models.ConfigItem
View Source
var KustomizeComponent = models.Component{
	ID:         uuid.MustParse("018cb576-4c81-91da-e59d-f25464b8bf91"),
	Name:       "kustomize-component",
	ExternalId: "dummy/kustomize-component",
	Type:       "FluxKustomize",
	CreatedAt:  DummyCreatedAt,
	ParentId:   &FluxComponent.ID,
	Status:     types.ComponentStatusHealthy,
	Properties: []*models.Property{{Name: "name", Text: "kustomize"}},
}
View Source
var KustomizeFluxComponent = models.Component{
	ID:         uuid.MustParse("018cb576-8036-10d8-edf1-cb49be2c0d93"),
	Name:       "kustomize-flux-component",
	ExternalId: "dummy/kustomize-flux-component",
	Type:       "Application",
	CreatedAt:  DummyCreatedAt,
	Status:     types.ComponentStatusHealthy,
	ParentId:   &KustomizeComponent.ID,
	Selectors: types.ResourceSelectors{
		{LabelSelector: "fluxcd.io/name=flux"},
	},
}
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,
	Health:     lo.ToPtr(models.HealthHealthy),
}
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(),
	Name:        lo.ToPtr("logistics-api"),
	Health:      lo.ToPtr(models.HealthHealthy),
	ConfigClass: models.ConfigClassDeployment,
	Tags: map[string]string{
		"namespace": "missioncontrol",
	},
	Config: lo.ToPtr(`{
      "apiVersion": "apps/v1",
      "kind": "Deployment",
      "metadata": {
        "name": "logistics-api",
        "labels": {
          "app": "logistics-api"
        }
      },
      "spec": {
        "replicas": 3,
        "selector": {
          "matchLabels": {
            "app": "logistics-api"
          }
        },
        "template": {
          "metadata": {
            "labels": {
              "app": "logistics-api"
            }
          },
          "spec": {
            "containers": [
              {
                "name": "logistics-api",
                "image": "logistics-api:latest",
                "ports": [
                  {
                    "containerPort": 80
                  }
                ]
              }
            ]
          }
        }
      }
    }`),
	Type: lo.ToPtr("Kubernetes::Deployment"),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "logistics",
		"environment": "production",
		"owner":       "team-1",
		"version":     "1.2.0",
	}),
}
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",
	Labels: map[string]string{
		"app": "logistics",
	},
}
View Source
var LogisticsAPIHealthHTTPCheckComponentRelationship = models.CheckComponentRelationship{
	ComponentID: LogisticsAPI.ID,
	CheckID:     LogisticsAPIHealthHTTPCheck.ID,
	CanaryID:    LogisticsAPIHealthHTTPCheck.CanaryID,
}
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",
	Labels: map[string]string{
		"app": "logistics",
	},
}
View Source
var LogisticsAPIHomeHTTPCheckComponentRelationship = models.CheckComponentRelationship{
	ComponentID: LogisticsAPI.ID,
	CheckID:     LogisticsAPIHomeHTTPCheck.ID,
	CanaryID:    LogisticsAPIHomeHTTPCheck.CanaryID,
}
View Source
var LogisticsAPIPod = models.Component{
	ID:         uuid.MustParse("018681ff-80ed-d10d-21ef-c74f152b085b"),
	Name:       "logistics-api-574dc95b5d-mp64w",
	Icon:       "icon-kubernetes-pod",
	Tooltip:    "Logistic API Pod",
	ExternalId: "dummy/logistics-api-574dc95b5d-mp64w",
	Type:       "KubernetesPod",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &PodsComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), PodsComponent.ID.String()),
	Properties: []*models.Property{{Name: "memory", Unit: "bytes", Value: lo.ToPtr(int64(100))}},
}
View Source
var LogisticsAPIPodConfig = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassPod,
	Name:        lo.ToPtr("logistics-api-pod-1"),
	Type:        lo.ToPtr("Kubernetes::Pod"),
	Health:      lo.ToPtr(models.HealthHealthy),
	CreatedAt:   DummyCreatedAt,
	Status:      lo.ToPtr("Running"),
	ParentID:    lo.ToPtr(LogisticsAPIReplicaSet.ID),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "logistics",
		"environment": "production",
		"owner":       "team-1",
		"version":     "1.2.0",
	}),
	Tags: map[string]string{
		"namespace": "missioncontrol",
	},
	CostTotal30d: 5,
}
View Source
var LogisticsAPIPodLogFile = models.Artifact{
	ID:       uuid.MustParse("018d411b-a35c-9d53-d223-454bdb173569"),
	Path:     "/logs/pods",
	Filename: "logistics-api.txt",
	Size:     1024,
}
View Source
var LogisticsAPIPodNodeAComponentRelationship = models.ComponentRelationship{
	ComponentID:    LogisticsAPIPod.ID,
	RelationshipID: NodeA.ID,
}
View Source
var LogisticsAPIReplicaSet = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: "ReplicaSet",
	Name:        lo.ToPtr("logistics-api"),
	Type:        lo.ToPtr("Kubernetes::ReplicaSet"),
	Health:      lo.ToPtr(models.HealthHealthy),
	Tags: map[string]string{
		"namespace": "missioncontrol",
	},
	ParentID: lo.ToPtr(LogisticsAPIDeployment.ID),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "logistics",
		"environment": "production",
		"owner":       "team-1",
		"version":     "1.2.0",
	}),
}
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",
	Labels: map[string]string{
		"app": "logistics",
	},
}
View Source
var LogisticsDBCheckComponentRelationship = models.CheckComponentRelationship{
	ComponentID: LogisticsDB.ID,
	CheckID:     LogisticsDBCheck.ID,
	CanaryID:    LogisticsDBCheck.CanaryID,
}
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,
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Logistics::DB::RDS"),
	Labels: lo.ToPtr(types.JSONStringMap{
		"database":    "logistics",
		"environment": "production",
		"region":      "us-east-1",
		"size":        "large",
	}),
	Tags: map[string]string{
		"namespace": "missioncontrol",
	},
}
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",
	Source:    models.SourceUI,
}
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(),
	Name:        lo.ToPtr("logistics-ui"),
	ConfigClass: models.ConfigClassDeployment,
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Kubernetes::Deployment"),
	Config: lo.ToPtr(`{
      "apiVersion": "apps/v1",
      "kind": "Deployment",
      "metadata": {
        "name": "logistics-ui",
        "namespace": "missioncontrol",
        "labels": {
          "app": "logistics-ui",
          "owner": "team-2"
        }
      },
      "spec": {
        "replicas": 2,
        "selector": {
          "matchLabels": {
            "app": "logistics-ui"
          }
        },
        "template": {
          "metadata": {
            "labels": {
              "app": "logistics-ui"
            }
          },
          "spec": {
            "containers": [
              {
                "name": "logistics-ui",
                "image": "logistics-ui:2.0.1",
                "ports": [
                  {
                    "containerPort": 8080
                  }
                ],
                "env": [
                  {
                    "name": "API_ENDPOINT",
                    "value": "http://logistics-api"
                  }
                ]
              }
            ]
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "logistics",
		"environment": "production",
		"owner":       "team-2",
		"version":     "2.0.1",
	}),
	Tags: map[string]string{
		"namespace": "missioncontrol",
	},
}
View Source
var LogisticsUIPod = models.Component{
	ID:         uuid.MustParse("018681ff-b6c1-a14d-2fd4-8c7dac94cddd"),
	Name:       "logistics-ui-676b85b87c-tjjcp",
	Icon:       "icon-kubernetes-pod",
	Tooltip:    "Logistic UI Pod",
	Type:       "KubernetesPod",
	ExternalId: "dummy/logistics-ui-676b85b87c-tjjcp",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &PodsComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), PodsComponent.ID.String()),
	Properties: []*models.Property{{Name: "memory", Unit: "bytes", Value: lo.ToPtr(int64(200))}},
}
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(),
	Name:        lo.ToPtr("logistics-worker"),
	ConfigClass: models.ConfigClassDeployment,
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Kubernetes::Deployment"),
	Config: lo.ToPtr(`{
      "apiVersion": "apps/v1",
      "kind": "Deployment",
      "metadata": {
        "name": "logistics-worker",
        "namespace": "missioncontrol",
        "labels": {
          "app": "logistics-worker",
          "owner": "team-3"
        }
      },
      "spec": {
        "replicas": 1,
        "selector": {
          "matchLabels": {
            "app": "logistics-worker"
          }
        },
        "template": {
          "metadata": {
            "labels": {
              "app": "logistics-worker"
            }
          },
          "spec": {
            "containers": [
              {
                "name": "logistics-worker",
                "image": "logistics-worker:1.5.0",
                "env": [
                  {
                    "name": "QUEUE_URL",
                    "value": "redis://redis:6379"
                  },
                  {
                    "name": "DATABASE_URL",
                    "value": "postgres://logistics-db:5432/logistics"
                  }
                ],
                "resources": {
                  "requests": {
                    "memory": "256Mi",
                    "cpu": "100m"
                  },
                  "limits": {
                    "memory": "512Mi",
                    "cpu": "500m"
                  }
                }
              }
            ]
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "logistics",
		"environment": "production",
		"owner":       "team-3",
		"version":     "1.5.0",
	}),
	Tags: map[string]string{
		"namespace": "missioncontrol",
	},
}
View Source
var LogisticsWorkerPod = models.Component{
	ID:         uuid.MustParse("018681ff-e578-a926-e366-d2dc0646eafa"),
	Name:       "logistics-worker-79cb67d8f5-lr66n",
	Icon:       "icon-kubernetes-pod",
	Tooltip:    "Logistic Worker Pod",
	ExternalId: "dummy/logistics-worker-79cb67d8f5-lr66n",
	Type:       "KubernetesPod",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &PodsComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), PodsComponent.ID.String()),
	Properties: []*models.Property{{Name: "memory", Unit: "bytes", Value: lo.ToPtr(int64(300))}},
}
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:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var Namespace models.ConfigItem
View Source
var NginxHelmRelease = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("nginx-ingress"),
	ConfigClass: "HelmRelease",
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Helm::Release"),
	Status:      lo.ToPtr("deployed"),
	Config: lo.ToPtr(`{
      "apiVersion": "helm.toolkit.fluxcd.io/v2beta1",
      "kind": "HelmRelease",
      "metadata": {
        "name": "nginx-ingress",
        "namespace": "ingress-nginx"
      },
      "spec": {
        "chart": {
          "spec": {
            "chart": "ingress-nginx",
            "version": "4.8.0",
            "sourceRef": {
              "kind": "HelmRepository",
              "name": "ingress-nginx"
            }
          }
        },
        "interval": "5m",
        "values": {
          "controller": {
            "replicaCount": 2
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "nginx-ingress",
		"environment": "production",
		"owner":       "platform-team",
		"version":     "4.8.0",
		"chart":       "ingress-nginx",
	}),
	Tags: map[string]string{
		"namespace": "ingress-nginx",
		"chart":     "ingress-nginx",
		"release":   "nginx-ingress",
	},
}
View Source
var NginxHelmReleaseUpgradeV1 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      NginxHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 72)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 4.7.0 to 4.7.1",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 72)),
}

Nginx Helm Release version upgrade changes

View Source
var NginxHelmReleaseUpgradeV2 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      NginxHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 48)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 4.7.1 to 4.7.2",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 48)),
}
View Source
var NginxHelmReleaseUpgradeV3 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      NginxHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 24)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 4.7.2 to 4.8.0",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 24)),
}
View Source
var NoMatchNotification = models.Notification{
	ID:        uuid.MustParse("605dcaaa-9637-4ff3-bb57-233b8a151e3a"),
	Name:      "no-match-notification",
	Namespace: "default",
	CreatedAt: time.Now(),
	UpdatedAt: time.Now(),
	Title:     "The title",
	Template:  "The body",
	Filter:    "false",
	PersonID:  &JohnDoe.ID,
	Source:    models.SourceUI,
	Events:    []string{"config.unhealthy", "config.warn"},
}
View Source
var NodeA = models.Component{
	ID:         uuid.MustParse("018681fe-f5aa-37e9-83f7-47b5b0232d5e"),
	Name:       "node-a",
	Icon:       "icon-kubernetes-node",
	Tooltip:    "Node A",
	ExternalId: "dummy/node-a",
	Type:       "KubernetesNode",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &NodesComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), NodesComponent.ID.String()),
}
View Source
var NodeB = models.Component{
	ID:         uuid.MustParse("018681ff-227e-4d71-b38e-0693cc862213"),
	Name:       "node-b",
	Icon:       "icon-kubernetes-node",
	Tooltip:    "Node B",
	ExternalId: "dummy/node-b",
	Type:       "KubernetesNode",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &NodesComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), NodesComponent.ID.String()),
}
View Source
var NodesComponent = models.Component{
	ID:         uuid.MustParse("018681fe-b27e-7627-72c2-ad18e93f72f4"),
	Name:       "Nodes",
	Icon:       "icon-kubernetes-node",
	Tooltip:    "Kubernetes Nodes",
	ExternalId: "dummy/nodes",
	Type:       "KubernetesNodes",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &ClusterComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       ClusterComponent.ID.String(),
}
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",
	Icon:       "icon-kubernetes-pod",
	Tooltip:    "Kubernetes Pods",
	ExternalId: "dummy/pods",
	Type:       "KubernetesPods",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &ClusterComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       ClusterComponent.ID.String(),
}
View Source
var RedisHelmRelease = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("redis"),
	ConfigClass: "HelmRelease",
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Helm::Release"),
	Status:      lo.ToPtr("deployed"),
	Config: lo.ToPtr(`{
      "apiVersion": "helm.toolkit.fluxcd.io/v2beta1",
      "kind": "HelmRelease",
      "metadata": {
        "name": "redis",
        "namespace": "database"
      },
      "spec": {
        "chart": {
          "spec": {
            "chart": "redis",
            "version": "18.1.5",
            "sourceRef": {
              "kind": "HelmRepository",
              "name": "bitnami"
            }
          }
        },
        "interval": "10m",
        "values": {
          "replica": {
            "replicaCount": 1
          },
          "auth": {
            "enabled": true
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "redis",
		"environment": "production",
		"owner":       "data-team",
		"version":     "18.1.5",
		"chart":       "redis",
	}),
	Tags: map[string]string{
		"namespace": "database",
		"chart":     "redis",
		"release":   "redis",
	},
}
View Source
var RedisHelmReleaseUpgradeV1 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      RedisHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 96)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 18.0.2 to 18.1.0",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 96)),
}

Redis Helm Release version upgrade changes

View Source
var RedisHelmReleaseUpgradeV2 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      RedisHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 60)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 18.1.0 to 18.1.3",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 60)),
}
View Source
var RedisHelmReleaseUpgradeV3 = models.ConfigChange{
	ID:         uuid.New().String(),
	ConfigID:   RedisHelmRelease.ID.String(),
	ChangeType: "UPDATE",
	CreatedAt:  lo.ToPtr(DummyNow.Add(-time.Hour * 36)),
	Severity:   models.SeverityInfo,
	Source:     "Flux",
	Summary:    "Helm chart upgraded from 18.1.3 to 18.1.5",
	Details: []byte(`{
		"old_version": "18.1.3",
		"new_version": "18.1.5"
	}`),
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 36)),
}
View Source
var SecondComment = models.Comment{
	ID:         uuid.New(),
	CreatedBy:  JohnDoe.ID,
	Comment:    "A comment by John Doe",
	IncidentID: LogisticsAPIDownIncident.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var SlackResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: UIDownIncident.ID,
	Type:       "Slack",
	TeamID:     &BackendTeam.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var TelegramResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: UIDownIncident.ID,
	Type:       "Telegram",
	PersonID:   &JohnDoe.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var ThirdComment = models.Comment{
	ID:         uuid.New(),
	CreatedBy:  JohnDoe.ID,
	Comment:    "Another comment by John Doe",
	IncidentID: LogisticsAPIDownIncident.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var UICanary = models.Canary{
	ID:        uuid.MustParse("c69f14cd-0041-4012-89f8-b5ed446ed8e9"),
	Name:      "ui-canary",
	Namespace: "cart",
	Spec:      []byte("{}"),
	CreatedAt: DummyCreatedAt,
	DeletedAt: lo.ToPtr(DummyCreatedAt.Add(time.Hour)),
}
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 AllDummyCheckStatuses

func AllDummyCheckStatuses() []models.CheckStatus

func AllDummyChecks

func AllDummyChecks() []models.Check

func AllDummyConfigAnalysis

func AllDummyConfigAnalysis() []models.ConfigAnalysis

func DeleteAll added in v1.0.561

func DeleteAll[T models.DBTable](gormDB *gorm.DB, items []T) error

func GetConfig added in v1.0.660

func GetConfig(configType, namespace, name string) models.ConfigItem

func ImportConfigs added in v1.0.660

func ImportConfigs(data []byte) (configs []models.ConfigItem, relationships []models.ConfigRelationship, err error)

Types

type DummyData

type DummyData struct {
	People []models.Person
	Agents []models.Agent

	Playbooks []models.Playbook

	Topologies             []models.Topology
	Components             []models.Component
	ComponentRelationships []models.ComponentRelationship

	Configs                      []models.ConfigItem
	ConfigRelationships          []models.ConfigRelationship
	ConfigScrapers               []models.ConfigScraper
	ConfigChanges                []models.ConfigChange
	ConfigAnalyses               []models.ConfigAnalysis
	ConfigComponentRelationships []models.ConfigComponentRelationship

	Notifications []models.Notification

	Teams      []models.Team
	Incidents  []models.Incident
	Hypotheses []models.Hypothesis
	Responders []models.Responder
	Evidences  []models.Evidence
	Comments   []models.Comment

	Canaries                    []models.Canary
	Checks                      []models.Check
	CheckStatuses               []models.CheckStatus
	CheckComponentRelationships []models.CheckComponentRelationship

	Artifacts    []models.Artifact
	JobHistories []models.JobHistory
}

func GenerateDynamicDummyData

func GenerateDynamicDummyData(db *gorm.DB) DummyData

GenerateDynamicDummyData is similar to GetStaticDummyData() except that the ids are randomly generated on call.

func GetStaticDummyData

func GetStaticDummyData(db *gorm.DB) DummyData

func (*DummyData) Delete

func (t *DummyData) Delete(gormDB *gorm.DB) error

func (*DummyData) Populate

func (t *DummyData) Populate(gormDB *gorm.DB) error

Jump to

Keyboard shortcuts

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