api

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyResults = errors.New("empty results")
)

Functions

func GetAccountByOrgId

func GetAccountByOrgId(orgId string) (ac *apistructs.CloudAccount, err error)

func GetDescribeMetricLast

func GetDescribeMetricLast(orgId, namespace, metricName string) (dataPoints []string, err error)

todo need as a requests pool

func ListAllOrgs

func ListAllOrgs() (res []apistructs.OrgDTO, err error)

func ListMetricMeta

func ListMetricMeta(orgId, namespace string) (res []cms.Resource, err error)

func ListProjectMeta

func ListProjectMeta(orgId string, products []string) (res []cms.Resource, err error)

func NewAliyunVendor

func NewAliyunVendor(ak, sk string, cfg AliyunConfig) (v *aliyun, err error)

func RegisterVendor

func RegisterVendor(orgId string, vendor CloudVendor)

Types

type AliyunConfig

type AliyunConfig struct {
	Timeout          time.Duration
	MaxQPS           int
	ReqLimit         uint64
	ReqLimitDuration time.Duration
}

type CloudVendor

type CloudVendor interface {
	DoReq(request interface{}, response interface{}) error
}

type DataPoints

type DataPoints string

type Metric

type Metric struct {
	Name      string                 `json:"name"`
	Timestamp uint64                 `json:"timestamp"`
	Tags      map[string]string      `json:"tags"`
	Fields    map[string]interface{} `json:"fields"`
}

Metric .

type MetricMeta

type MetricMeta struct {
}

type OrgInfo

type OrgInfo struct {
	OrgId        string
	OrgName      string
	AccessKey    string
	AccessSecret string
}

OrgInfo .

func ListOrgInfos

func ListOrgInfos() (res []OrgInfo, err error)

type ProjectMeta

type ProjectMeta struct {
	Description string
	Labels      map[string]interface{}
	Namespace   string
}

ProjectMeta .

Jump to

Keyboard shortcuts

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