models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 15 Imported by: 5

Documentation

Index

Constants

View Source
const (
	IsContainer = "isContainer"
)

Dgraph Model Constants

View Source
const (
	IsDaemonset = "isDaemonset"
)

Dgraph Model Constants

View Source
const (
	IsDeployment = "isDeployment"
)

Dgraph Model Constants

View Source
const (
	IsJob = "isJob"
)

Dgraph Model Constants

View Source
const (
	IsNamespace = "isNamespace"
)

Dgraph Model Constants

View Source
const (
	IsNode = "isNode"
)

Dgraph Model Constants

View Source
const (
	IsPersistentVolume = "isPersistentVolume"
)

Dgraph Model Constants

View Source
const (
	IsPersistentVolumeClaim = "isPersistentVolumeClaim"
)

Dgraph Model Constants

View Source
const (
	IsPod = "isPod"
)

Dgraph Model Constants

View Source
const (
	IsProc = "isProc"
)

Dgraph Model Constants

View Source
const (
	IsPurserGroup = "isPurserGroup"
)

Dgraph Model Constants

View Source
const (
	IsReplicaset = "isReplicaset"
)

Dgraph Model Constants

View Source
const (
	IsService = "isService"
)

Dgraph Model Constants

View Source
const (
	IsStatefulset = "isStatefulset"
)

Dgraph Model Constants

View Source
const (
	IsSubscriber = "isSubscriber"
)

Dgraph Model Constants

Variables

This section is empty.

Functions

func CreateOrGetDaemonsetByID

func CreateOrGetDaemonsetByID(xid string) string

CreateOrGetDaemonsetByID returns the uid of namespace if exists, otherwise creates the daemonset and returns uid.

func CreateOrGetDeploymentByID

func CreateOrGetDeploymentByID(xid string) string

CreateOrGetDeploymentByID returns the uid of namespace if exists, otherwise creates the deployment and returns uid.

func CreateOrGetJobByID

func CreateOrGetJobByID(xid string) string

CreateOrGetJobByID returns the uid of namespace if exists, otherwise creates the job and returns uid.

func CreateOrGetNamespaceByID

func CreateOrGetNamespaceByID(xid string) string

CreateOrGetNamespaceByID returns the uid of namespace if exists, otherwise creates the namespace and returns uid.

func CreateOrGetPersistentVolumeByID

func CreateOrGetPersistentVolumeByID(xid string) string

CreateOrGetPersistentVolumeByID returns the uid of persistent volume if exists, otherwise creates the persistent volume and returns uid.

func CreateOrGetPersistentVolumeClaimByID

func CreateOrGetPersistentVolumeClaimByID(xid string) string

CreateOrGetPersistentVolumeClaimByID returns the uid of pvc if exists, otherwise creates the pvc and returns uid.

func CreateOrGetReplicasetByID

func CreateOrGetReplicasetByID(xid string) string

CreateOrGetReplicasetByID returns the uid of namespace if exists, otherwise creates the replicaset and returns uid.

func CreateOrGetStatefulsetByID

func CreateOrGetStatefulsetByID(xid string) string

CreateOrGetStatefulsetByID returns the uid of namespace if exists, otherwise creates the stateful and returns uid.

func StoreAndRetrieveContainersAndMetrics

func StoreAndRetrieveContainersAndMetrics(pod api_v1.Pod, podUID, namespaceUID string) ([]*Container, Metrics)

StoreAndRetrieveContainersAndMetrics fetchs the list of containers in given pod Create a new container in dgraph if container is not in it.

func StoreContainerProcessEdge

func StoreContainerProcessEdge(containerXID string, procsXIDs []string) error

StoreContainerProcessEdge ...

func StoreDaemonset

func StoreDaemonset(daemonset ext_v1beta1.DaemonSet) (string, error)

StoreDaemonset create a new daemonset in the Dgraph and updates if already present.

func StoreDeployment

func StoreDeployment(deployment apps_v1beta1.Deployment) (string, error)

StoreDeployment create a new deployment in the Dgraph and updates if already present.

func StoreGroupCRD

func StoreGroupCRD(group groups_v1.Group) (string, error)

StoreGroupCRD create a new group CRD in the Dgraph and updates if already present.

func StoreJob

func StoreJob(job batch_v1.Job) (string, error)

StoreJob create a new daemonset in the Dgraph and updates if already present.

func StoreNamespace

func StoreNamespace(namespace api_v1.Namespace) (string, error)

StoreNamespace create a new namespace in the Dgraph if it is not present.

func StoreNode

func StoreNode(node api_v1.Node) (string, error)

StoreNode create a new node in the Dgraph if it is not present.

func StorePersistentVolume

func StorePersistentVolume(pv api_v1.PersistentVolume) (string, error)

StorePersistentVolume create a new persistent volume in the Dgraph and updates if already present.

func StorePersistentVolumeClaim

func StorePersistentVolumeClaim(pvc api_v1.PersistentVolumeClaim) (string, error)

StorePersistentVolumeClaim create a new pvc in the Dgraph and updates if already present.

func StorePod

func StorePod(k8sPod api_v1.Pod) error

StorePod updates the pod details and create it a new node if not exists. It also populates Containers of a pod.

func StorePodServiceEdges

func StorePodServiceEdges(svcXID string, podsXIDsInService []string) error

StorePodServiceEdges saves pods in Services object in the dgraph

func StorePodsInteraction

func StorePodsInteraction(sourcePodXID string, destinationPodsXIDs []string, counts []float64) error

StorePodsInteraction store the pod interactions in Dgraph

func StoreProcess

func StoreProcess(procXID, containerXID string, podsXIDs []string, creationTimeStamp time.Time) error

StoreProcess ...

func StoreReplicaset

func StoreReplicaset(replicaset ext_v1beta1.ReplicaSet) (string, error)

StoreReplicaset create a new replicaset in the Dgraph and updates if already present.

func StoreService

func StoreService(service api_v1.Service) error

StoreService create a new node in the Dgraph if it is not present.

func StoreServicesInteraction

func StoreServicesInteraction(sourceServiceXID string, destinationServicesXIDs []string) error

StoreServicesInteraction stores the service interaction data in the Dgraph

func StoreStatefulset

func StoreStatefulset(statefulset apps_v1beta1.StatefulSet) (string, error)

StoreStatefulset create a new statefulset in the Dgraph and updates if already present.

func StoreSubscriberCRD

func StoreSubscriberCRD(subscriber subscribers_v1.Subscriber) (string, error)

StoreSubscriberCRD create a new subscriber CRD in the Dgraph and updates if already present.

Types

type Container

type Container struct {
	dgraph.ID
	IsContainer   bool       `json:"isContainer,omitempty"`
	Name          string     `json:"name,omitempty"`
	StartTime     string     `json:"startTime,omitempty"`
	EndTime       string     `json:"endTime,omitempty"`
	Pod           Pod        `json:"pod,omitempty"`
	Procs         []*Proc    `json:"procs,omitempty"`
	Namespace     *Namespace `json:"namespace,omitempty"`
	CPURequest    float64    `json:"cpuRequest,omitempty"`
	CPULimit      float64    `json:"cpuLimit,omitempty"`
	MemoryRequest float64    `json:"memoryRequest,omitempty"`
	MemoryLimit   float64    `json:"memoryLimit,omitempty"`
	Type          string     `json:"type,omitempty"`
}

Container schema in dgraph

type Daemonset

type Daemonset struct {
	dgraph.ID
	IsDaemonset bool       `json:"isDaemonset,omitempty"`
	Name        string     `json:"name,omitempty"`
	StartTime   string     `json:"startTime,omitempty"`
	EndTime     string     `json:"endTime,omitempty"`
	Namespace   *Namespace `json:"namespace,omitempty"`
	Pods        []*Pod     `json:"pod,omitempty"`
	Type        string     `json:"type,omitempty"`
}

Daemonset schema in dgraph

type Deployment

type Deployment struct {
	dgraph.ID
	IsDeployment bool       `json:"isDeployment,omitempty"`
	Name         string     `json:"name,omitempty"`
	StartTime    string     `json:"startTime,omitempty"`
	EndTime      string     `json:"endTime,omitempty"`
	Namespace    *Namespace `json:"namespace,omitempty"`
	Pods         []*Pod     `json:"pod,omitempty"`
	Type         string     `json:"type,omitempty"`
}

Deployment schema in dgraph

type GroupCRD

type GroupCRD struct {
	dgraph.ID
	IsPurserGroup bool   `json:"isPurserGroup,omitempty"`
	Name          string `json:"name,omitempty"`
	StartTime     string `json:"startTime,omitempty"`
	EndTime       string `json:"endTime,omitempty"`
	Type          string `json:"type,omitempty"`
}

GroupCRD schema in dgraph

type Job

type Job struct {
	dgraph.ID
	IsJob     bool       `json:"isJob,omitempty"`
	Name      string     `json:"name,omitempty"`
	StartTime string     `json:"startTime,omitempty"`
	EndTime   string     `json:"endTime,omitempty"`
	Namespace *Namespace `json:"namespace,omitempty"`
	Pods      []*Pod     `json:"pod,omitempty"`
	Type      string     `json:"type,omitempty"`
}

Job schema in dgraph

type Metrics

type Metrics struct {
	CPURequest    float64
	CPULimit      float64
	MemoryRequest float64
	MemoryLimit   float64
}

Metrics ...

type Namespace

type Namespace struct {
	dgraph.ID
	IsNamespace bool   `json:"isNamespace,omitempty"`
	Name        string `json:"name,omitempty"`
	StartTime   string `json:"startTime,omitempty"`
	EndTime     string `json:"endTime,omitempty"`
	Type        string `json:"type,omitempty"`
}

Namespace schema in dgraph

type Node

type Node struct {
	dgraph.ID
	IsNode         bool    `json:"isNode,omitempty"`
	Name           string  `json:"name,omitempty"`
	StartTime      string  `json:"startTime,omitempty"`
	EndTime        string  `json:"endTime,omitempty"`
	Pods           []*Pod  `json:"pods,omitempty"`
	CPUCapity      float64 `json:"cpuCapacity,omitempty"`
	MemoryCapacity float64 `json:"memoryCapacity,omitempty"`
	Type           string  `json:"type,omitempty"`
}

Node schema in dgraph

type PersistentVolume

type PersistentVolume struct {
	dgraph.ID
	IsPersistentVolume bool    `json:"isPersistentVolume,omitempty"`
	Name               string  `json:"name,omitempty"`
	StartTime          string  `json:"startTime,omitempty"`
	EndTime            string  `json:"endTime,omitempty"`
	Type               string  `json:"type,omitempty"`
	StorageCapacity    float64 `json:"storageCapacity,omitempty"`
}

PersistentVolume schema in dgraph

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	dgraph.ID
	IsPersistentVolumeClaim bool              `json:"isPersistentVolumeClaim,omitempty"`
	Name                    string            `json:"name,omitempty"`
	StartTime               string            `json:"startTime,omitempty"`
	EndTime                 string            `json:"endTime,omitempty"`
	Namespace               *Namespace        `json:"namespace,omitempty"`
	Type                    string            `json:"type,omitempty"`
	StorageCapacity         float64           `json:"storageCapacity,omitempty"`
	PersistentVolume        *PersistentVolume `json:"persistentvolume,omitempty"`
}

PersistentVolumeClaim schema in dgraph

type Pod

type Pod struct {
	dgraph.ID
	IsPod          bool                     `json:"isPod,omitempty"`
	Name           string                   `json:"name,omitempty"`
	StartTime      string                   `json:"startTime,omitempty"`
	EndTime        string                   `json:"endTime,omitempty"`
	Containers     []*Container             `json:"containers,omitempty"`
	Pods           []*Pod                   `json:"pod,omitempty"`
	Count          float64                  `json:"pod|count,omitempty"`
	Node           *Node                    `json:"node,omitempty"`
	Namespace      *Namespace               `json:"namespace,omitempty"`
	Deployment     *Deployment              `json:"deployment,omitempty"`
	Replicaset     *Replicaset              `json:"replicaset,omitempty"`
	Statefulset    *Statefulset             `json:"statefulset,omitempty"`
	Daemonset      *Daemonset               `json:"daemonset,omitempty"`
	Job            *Job                     `json:"job,omitempty"`
	Pvcs           []*PersistentVolumeClaim `json:"pvc,omitempty"`
	CPURequest     float64                  `json:"cpuRequest,omitempty"`
	CPULimit       float64                  `json:"cpuLimit,omitempty"`
	MemoryRequest  float64                  `json:"memoryRequest,omitempty"`
	MemoryLimit    float64                  `json:"memoryLimit,omitempty"`
	StorageRequest float64                  `json:"storageRequest,omitempty"`
	Type           string                   `json:"type,omitempty"`
	Cid            []Service                `json:"cid,omitempty"`
}

Pod schema in dgraph

type Proc

type Proc struct {
	dgraph.ID
	IsProc    bool       `json:"isProc,omitemtpy"`
	Name      string     `json:"name,omitempty"`
	Interacts []*Pod     `json:"interacts,omitempty"`
	Container Container  `json:"container,omitempty"`
	StartTime string     `json:"startTime,omitempty"`
	EndTime   string     `json:"endTime,omitempty"`
	Namespace *Namespace `json:"namespace,omitempty"`
	Type      string     `json:"type,omitempty"`
}

Proc schema in dgraph

type Replicaset

type Replicaset struct {
	dgraph.ID
	IsReplicaset bool        `json:"isReplicaset,omitempty"`
	Name         string      `json:"name,omitempty"`
	StartTime    string      `json:"startTime,omitempty"`
	EndTime      string      `json:"endTime,omitempty"`
	Namespace    *Namespace  `json:"namespace,omitempty"`
	Deployment   *Deployment `json:"deployment,omitempty"`
	Pods         []*Pod      `json:"pod,omitempty"`
	Type         string      `json:"type,omitempty"`
}

Replicaset schema in dgraph

type Service

type Service struct {
	dgraph.ID
	IsService bool       `json:"isService,omitempty"`
	Name      string     `json:"name,omitempty"`
	StartTime string     `json:"startTime,omitempty"`
	EndTime   string     `json:"endTime,omitempty"`
	Pod       []*Pod     `json:"pod,omitempty"`
	Interacts []*Service `json:"interacts,omitempty"`
	Namespace *Namespace `json:"namespace,omitempty"`
	Type      string     `json:"type,omitempty"`
}

Service model structure in Dgraph

func RetrieveAllServices

func RetrieveAllServices() ([]Service, error)

RetrieveAllServices returns all pods in the dgraph

func RetrieveAllServicesWithDstPods

func RetrieveAllServicesWithDstPods() ([]Service, error)

RetrieveAllServicesWithDstPods returns all pods in the dgraph

func RetrieveServiceList

func RetrieveServiceList() ([]Service, error)

RetrieveServiceList ...

type Statefulset

type Statefulset struct {
	dgraph.ID
	IsStatefulset bool       `json:"isStatefulset,omitempty"`
	Name          string     `json:"name,omitempty"`
	StartTime     string     `json:"startTime,omitempty"`
	EndTime       string     `json:"endTime,omitempty"`
	Namespace     *Namespace `json:"namespace,omitempty"`
	Pods          []*Pod     `json:"pods,omitempty"`
	Type          string     `json:"type,omitempty"`
}

Statefulset schema in dgraph

type SubscriberCRD

type SubscriberCRD struct {
	dgraph.ID
	IsSubscriber bool   `json:"isSubscriber,omitempty"`
	Name         string `json:"name,omitempty"`
	StartTime    string `json:"startTime,omitempty"`
	EndTime      string `json:"endTime,omitempty"`
	Type         string `json:"type,omitempty"`
}

SubscriberCRD schema in dgraph

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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