resource_service

package
v0.0.0-...-5fda629 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MulanPSL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Name string `json:"name"`
}

type Child

type Child struct {
	Name        string   `json:"name"`
	GuId        string   `json:"guId"`
	Status      int      `json:"status"`
	OType       int      `json:"oType"`
	Description string   `json:"description"`
	Area        string   `json:"area"`
	Visiable    int      `json:"visiable"`
	Children    []*Child `json:"children"`
}
type Dropdown struct {
	ID    int    `json:"id"`
	Key   string `json:"key"`
	Value string `json:"value"`
}
type Link struct {
	//SourceName string
	SourceGuId string `json:"source"`
	//TargetName string
	TargetGuId string `json:"target"`
}

type Node

type Node struct {
	Name       string  `json:"name"`
	GuId       string  `json:"id"`
	Category   int     `json:"category"`
	SymbolSize float64 `json:"symbolSize"`
}

type Resource

type Resource struct {
	GuId        string
	Description string
	Status      int
	Area        string
	PreNode     string
	SubNode     string
	OType       int
	Utilization int
	CreateTime  string
	UpdateTime  string
	IsMonitor   int
	IsControl   int
	//AutoRemove  int
	Tags []Tag

	CpuSet   string
	CpuRatio float64

	ID       int
	PageNum  int
	PageSize int
	Param    string
	GuIds    []string
}

func (*Resource) Add

func (r *Resource) Add() error

func (*Resource) CheckMetricExist

func (r *Resource) CheckMetricExist() (bool, error)

func (*Resource) CheckProperty

func (r *Resource) CheckProperty() (*models.Resource, error)

func (*Resource) Count

func (r *Resource) Count() (int, error)

func (*Resource) CreateTagInfo

func (r *Resource) CreateTagInfo(tag *spongeregister.Tag, resource *models.Resource) error

func (*Resource) DeleteResource

func (r *Resource) DeleteResource() error

func (*Resource) DeleteResources

func (r *Resource) DeleteResources() error

func (*Resource) DeleteTagInfos

func (r *Resource) DeleteTagInfos() error

func (*Resource) ExistByGuId

func (r *Resource) ExistByGuId() (bool, error)

func (*Resource) GetAtlasMap

func (r *Resource) GetAtlasMap() ([]Node, []Link, []Category, error)

func (*Resource) GetDeviceIds

func (r *Resource) GetDeviceIds() ([]string, error)

func (*Resource) GetDeviceInfo

func (r *Resource) GetDeviceInfo() (*models.Resource, error)

func (*Resource) GetDeviceInfos

func (r *Resource) GetDeviceInfos() ([]*models.Resource, error)

func (*Resource) GetOtypeDropdownList

func (r *Resource) GetOtypeDropdownList() ([]Dropdown, error)

func (*Resource) GetRelationGraph

func (r *Resource) GetRelationGraph() ([]Node, []Link, []Category, error)

func (*Resource) GetRelationMap

func (r *Resource) GetRelationMap() ([]Node, []Link, error)

func (*Resource) GetRelationResources

func (r *Resource) GetRelationResources() ([]*models.Resource, error)

func (*Resource) GetResourceInfo

func (r *Resource) GetResourceInfo() (*models.Resource, error)

func (*Resource) GetResourceTagByKey

func (r *Resource) GetResourceTagByKey(key string) (*models.Tag, error)

func (*Resource) GetResourcesByCity

func (r *Resource) GetResourcesByCity() ([]models.CityResource, error)

func (*Resource) GetStatisticDropdownList

func (r *Resource) GetStatisticDropdownList() ([]Dropdown, error)

func (*Resource) GetSunburstMap

func (r *Resource) GetSunburstMap(keyword string, oType int, status int) ([]*Child, error)

func (*Resource) GetTagGroupInfos

func (r *Resource) GetTagGroupInfos(tagKey string, tagValue string) ([]*models.ResourceMetric, error)

func (*Resource) GetTagInfosByGuId

func (r *Resource) GetTagInfosByGuId() ([]*models.Tag, error)

func (*Resource) GetUtilizationInfo

func (r *Resource) GetUtilizationInfo() ([]models.UtilizationInfo, error)

func (*Resource) InsertMetricInfo

func (r *Resource) InsertMetricInfo() error

func (*Resource) RenewalDevice

func (r *Resource) RenewalDevice() string

func (*Resource) SearchResources

func (r *Resource) SearchResources() ([]*models.Resource, error)

func (*Resource) SearchResourcesByType

func (r *Resource) SearchResourcesByType() ([]models.TypeCount, []models.TypeCount, error)

func (*Resource) UpdateMetricInfo

func (r *Resource) UpdateMetricInfo() error

func (*Resource) UpdateStatus

func (r *Resource) UpdateStatus() error

func (*Resource) UpdateSubNode

func (r *Resource) UpdateSubNode() error

func (*Resource) UpdateTagInfo

func (r *Resource) UpdateTagInfo(tag *spongeregister.Tag, resource *models.Resource) error

type Tag

type Tag struct {
	Key   string      `json:"key"`
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

Jump to

Keyboard shortcuts

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