aliyun

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultReportDimensions = map[string][]ReportDimension{
	"ECS": {
		{"CPU", "cpu_total"},
		{"内存", "memory_usedutilization"},
		{"连接数", "concurrentConnections"},
	},
	"RDS": {
		{"CPU 使用率", "CpuUsage"},
		{"内存使用率", "MemoryUsage"},
		{"连接数使用率", "ConnectionUsage"},
	},
	"KVSTORE": {
		{"CPU 使用率", "CpuUsage"},
		{"内存使用率", "MemoryUsage"},
		{"连接数使用率", "ConnectionUsage"},
	},
	"SLB": {
		{"流入带宽", "TrafficRXNew"},
		{"活跃连接数", "ActiveConnection"},
		{"并发连接数", "MaxConnection"},
	},
	"CDN": {
		{"宽带峰值", "BPS"},
		{"下行流量", "InternetOut"},
		{"QPS", "QPS"},
	},
}

DefaultReportDimensions type

View Source
var RegionMap = map[string]string{
	"cn-hangzhou":    "华东 1 (杭州)",
	"cn-shanghai":    "华东 2 (上海)",
	"cn-qingdao":     "华北 1 (青岛)",
	"cn-beijing":     "华北 2 (北京)",
	"cn-shenzhen":    "华南 1 (深圳)",
	"cn-zhangjiakou": "华北 3(张家口)",
	"cn-hongkong":    "香港",
}

RegionMap of aliyun

Functions

This section is empty.

Types

type Aliyun

type Aliyun struct {
	AccessKey       string
	AccessKeySecret string
}

Aliyun instance

func NewWithEnv

func NewWithEnv() *Aliyun

NewWithEnv new Aliyun with env

func (*Aliyun) GetClient

func (aliyun *Aliyun) GetClient(regionID string) (client *cms.Client, err error)

GetClient reurn a cms client

func (*Aliyun) GetGroupList

func (aliyun *Aliyun) GetGroupList(params *GetGroupListParams) (groupList []*Group, err error)

GetGroupList func

func (*Aliyun) GetGroupResources

func (aliyun *Aliyun) GetGroupResources(params *GetGroupResourcesParams) (resources []*GroupResource, err error)

GetGroupResources by id

func (*Aliyun) GetMetricList

func (aliyun *Aliyun) GetMetricList(params *GetMetricListParams) (response *cms.DescribeMetricListResponse, err error)

GetMetricList data

func (*Aliyun) GetMetricReport

func (aliyun *Aliyun) GetMetricReport(params *GetMetricReportParams) (resp *MetricReportResponse, err error)

GetMetricReport json

func (*Aliyun) GetMetricTop

func (aliyun *Aliyun) GetMetricTop(params *GetMetricTopParams) (datapoints []Datapoint, err error)

GetMetricTop data

func (*Aliyun) GetMonitorNamespaces

func (aliyun *Aliyun) GetMonitorNamespaces() (namespaces []*MonitorNamespace, err error)

GetMonitorNamespaces support

type CommonParams

type CommonParams struct {
	RegionID string `json:"RegionId"`
}

CommonParams type

type Datapoint

type Datapoint struct {
	Timestamp  int
	InstanceID string `json:"instanceId"`
	Minimum    float64
	Average    float64
	Maximum    float64
}

Datapoint type

type Dimension

type Dimension struct {
	InstanceID string `json:"instanceId"`
}

Dimension type

type DimensionReport

type DimensionReport struct {
	ReportDimension
	Error string
	Max   float64
	Avg   float64
}

DimensionReport of instance

type GetGroupListParams

type GetGroupListParams struct {
	CommonParams
	Keyword string
}

GetGroupListParams type

type GetGroupResourcesParams

type GetGroupResourcesParams struct {
	CommonParams
	GroupID  int    `json:"GroupId"`
	Category string ``
	Keyword  string ``
}

GetGroupResourcesParams type

type GetMetricListParams

type GetMetricListParams struct {
	CommonParams
	Dimensions string
	MetricName string
	Namespace  string
	Period     string
	StartTime  string
	EndTime    string
	Express    string
	Length     string
}

GetMetricListParams type

type GetMetricReportParams

type GetMetricReportParams struct {
	StartTime string ``
	EndTime   string ``
	GroupID   int    `json:"GroupId"` // 应用分组的 ID
}

GetMetricReportParams type

type GetMetricTopParams

type GetMetricTopParams struct {
	GetMetricListParams
	Orderby string // Maximum Average
}

GetMetricTopParams type

type Group

type Group struct {
	GroupID   int `json:"GroupId"`
	GroupName string
	Type      string
}

Group type

type GroupResource

type GroupResource struct {
	Category     string ``                  // 产品名称缩写
	ID           int    `json:"Id"`         // 资源ID
	InstanceID   string `json:"InstanceId"` // 实例ID,实例的唯一标识
	InstanceName string ``                  // 实例名称
	RegionID     string `json:"RegionId"`
}

GroupResource type

type MetricReport

type MetricReport struct {
	*GroupResource
	Dimensions []*DimensionReport
	Error      string
}

MetricReport type

type MetricReportResponse

type MetricReportResponse struct {
	Errors []string
	Report map[string][]*MetricReport
}

MetricReportResponse type

type MonitorNamespace

type MonitorNamespace struct {
	Namespace   string
	Description string
}

MonitorNamespace type

type ReportDimension

type ReportDimension struct {
	DisplayName string
	Name        string
}

ReportDimension type

type SLBDimension

type SLBDimension struct {
	Dimension
	Port string `json:"port"`
}

SLBDimension type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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