cloudwatch

package
v0.22.48 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cloudwatch include resources of ucloud cloudwatch product

See also

for detail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertRecord

type AlertRecord struct {

	// 告警恢复时间
	EndAt int

	// 告警等级
	Level string

	// 指标id
	MetricID int

	// 指标名称
	MetricName string

	// 产品类型名称
	ProductName string

	// 产品类型
	ProductType int

	// 项目ProjectID
	ProjectID int

	// 告警记录RecordID
	RecordID int

	// 可用区
	Region string

	// 资源id
	ResourceID string

	// 告警记录触发告警规则Id
	RuleID int

	// 告警屏蔽规则id(如果配置了屏蔽规则,并且满足条件)
	ShieldRuleID int

	// 告警触发时间
	StartAt int

	// 告警状态
	Status string

	// 告警记录触发告警策略Id
	StrategyID int

	// 告警记录触发告警策略名称
	StrategyName string

	// 告警点tag信息
	Tag []string

	// 比较符
	ThresholdCompare string

	// 告警阈值
	ThresholdValue string

	// 指标单位名称
	UnitName string

	// 告警当前值
	Value int
}

AlertRecord - 告警记录模型

type AlertRule

type AlertRule struct {

	// 告警等级
	Level string

	// 指标ID
	MetricID int

	// 指标名称
	MetricName string

	// 规则ID
	RuleID int

	// 发送间隔
	SendInterval int

	// 触发周期
	SendPeriodType string

	// 告警状态
	Status int

	// 阈值比较方式
	ThresholdCompare int

	// 阈值
	ThresholdValue float64

	// 触发次数
	TriggerCount int
}

AlertRule - 告警规则

type AlertStrategy

type AlertStrategy struct {

	// 告警策略Id
	AlertStrategyID int

	// 回调语言(cn,en)
	CallbackLanguage string

	// 回调地址
	CallbackUrls []string

	// 告警规则配置类型(基于模板配置、基于手工配置)
	ConfigMode int

	// 创建时间
	CreatedAt int

	// 创建人
	CreatedBy string

	// 告警策略名称
	Name string

	// 通知渠道('email', 'sms', 'webhook')
	NotifyChannelDs []string

	// 通知组id集合
	NotifyGroupIDs []int

	// 通知方式(通知组:group,通知人:user)
	NotifyType string

	// 通知人用户id集合
	NotifyUserIDs []int

	// 资源类型名称
	ProductKey string

	// 资源类型
	ProductType int

	// 告警策略备注
	Remark string

	// 告警规则集合
	RuleSet []AlertRule

	// 告警策略状态
	Status int

	// 模板Id
	TemplateId int

	// 更新时间
	UpdatedAt int

	// 更新人
	UpdatedBy string
}

AlertStrategy - 告警策略模型

type AlertTemplate

type AlertTemplate struct {

	// 告警模板ID
	TemplateID int
}

AlertTemplate - 告警模板对象

type BindAlertStrategyRequest

type BindAlertStrategyRequest struct {
	request.CommonBase

	// 告警策略id数组
	AlertStrategyIDs []int `required:"true"`

	// 产品类型名称
	ProductKey *string `required:"true"`

	// 资源数组
	Resources []string `required:"true"`
}

BindAlertStrategyRequest is request schema for BindAlertStrategy action

type BindAlertStrategyResponse

type BindAlertStrategyResponse struct {
	response.CommonBase
}

BindAlertStrategyResponse is response schema for BindAlertStrategy action

type CloudWatchClient

type CloudWatchClient struct {
	*ucloud.Client
}

CloudWatchClient is the client of CloudWatch

func NewClient

func NewClient(config *ucloud.Config, credential *auth.Credential) *CloudWatchClient

NewClient will return a instance of CloudWatchClient

func (*CloudWatchClient) BindAlertStrategy

API: BindAlertStrategy

绑定告警策略

func (*CloudWatchClient) CreateAlertStrategyTemplate

API: CreateAlertStrategyTemplate

新建条件模板

func (*CloudWatchClient) DeleteAlertStrategyTemplate

API: DeleteAlertStrategyTemplate

删除告警策略模板

func (*CloudWatchClient) GetProductMetrics

API: GetProductMetrics

获取云产品关联的指标列表

func (*CloudWatchClient) ListAlertRecord

API: ListAlertRecord

获取时间段内的告警记录

func (*CloudWatchClient) ListAlertStrategy

API: ListAlertStrategy

获取告警策略列表

func (*CloudWatchClient) ListMonitorProduct

API: ListMonitorProduct

获取监控对象类型列表

func (*CloudWatchClient) NewBindAlertStrategyRequest

func (c *CloudWatchClient) NewBindAlertStrategyRequest() *BindAlertStrategyRequest

NewBindAlertStrategyRequest will create request of BindAlertStrategy action.

func (*CloudWatchClient) NewCreateAlertStrategyTemplateRequest

func (c *CloudWatchClient) NewCreateAlertStrategyTemplateRequest() *CreateAlertStrategyTemplateRequest

NewCreateAlertStrategyTemplateRequest will create request of CreateAlertStrategyTemplate action.

func (*CloudWatchClient) NewDeleteAlertStrategyTemplateRequest

func (c *CloudWatchClient) NewDeleteAlertStrategyTemplateRequest() *DeleteAlertStrategyTemplateRequest

NewDeleteAlertStrategyTemplateRequest will create request of DeleteAlertStrategyTemplate action.

func (*CloudWatchClient) NewGetProductMetricsRequest

func (c *CloudWatchClient) NewGetProductMetricsRequest() *GetProductMetricsRequest

NewGetProductMetricsRequest will create request of GetProductMetrics action.

func (*CloudWatchClient) NewListAlertRecordRequest

func (c *CloudWatchClient) NewListAlertRecordRequest() *ListAlertRecordRequest

NewListAlertRecordRequest will create request of ListAlertRecord action.

func (*CloudWatchClient) NewListAlertStrategyRequest

func (c *CloudWatchClient) NewListAlertStrategyRequest() *ListAlertStrategyRequest

NewListAlertStrategyRequest will create request of ListAlertStrategy action.

func (*CloudWatchClient) NewListMonitorProductRequest

func (c *CloudWatchClient) NewListMonitorProductRequest() *ListMonitorProductRequest

NewListMonitorProductRequest will create request of ListMonitorProduct action.

func (*CloudWatchClient) NewQueryMetricDataSetRequest

func (c *CloudWatchClient) NewQueryMetricDataSetRequest() *QueryMetricDataSetRequest

NewQueryMetricDataSetRequest will create request of QueryMetricDataSet action.

func (*CloudWatchClient) NewQueryMetricDataSummaryRequest

func (c *CloudWatchClient) NewQueryMetricDataSummaryRequest() *QueryMetricDataSummaryRequest

NewQueryMetricDataSummaryRequest will create request of QueryMetricDataSummary action.

func (*CloudWatchClient) NewUnBindAlertStrategyRequest

func (c *CloudWatchClient) NewUnBindAlertStrategyRequest() *UnBindAlertStrategyRequest

NewUnBindAlertStrategyRequest will create request of UnBindAlertStrategy action.

func (*CloudWatchClient) QueryMetricDataSet

API: QueryMetricDataSet

查询监控指标数据集

func (*CloudWatchClient) QueryMetricDataSummary

API: QueryMetricDataSummary

获取资源看图属性列表

func (*CloudWatchClient) UnBindAlertStrategy

API: UnBindAlertStrategy

解绑告警策略

type ConversionRule

type ConversionRule struct {

	// 转换因子
	ConversionFactor int

	// 来源
	From string

	// 目标
	To string
}

ConversionRule - 指标单位转换规则

type CreateAlertStrategyTemplateParamRuleSet

type CreateAlertStrategyTemplateParamRuleSet struct {

	// 告警等级。枚举值:P0,P1,P2,P3
	Level *string `required:"true"`

	// 规则指标ID。参考该类型产品下返回的指标列表GetProductMetrics
	MetricID *int `required:"true"`

	// 沉默周期(告警周期选择为连续时必填)
	SendInterval *int `required:"false"`

	// 触发周期。枚举值:continuous连续 exponent 指数 single 不重复
	SendPeriodType *string `required:"true"`

	// 告警状态。枚举值:0-关闭 1-开启
	Status *int `required:"true"`

	// 阈值比较方式。枚举值比较方式: 1->=2-<= 3-> 4-< 5-== 6-!=
	ThresholdCompare *int `required:"true"`

	// 触发阈值
	ThresholdValue *int `required:"true"`

	// 触发次数
	TriggerCount *int `required:"true"`
}

CreateAlertStrategyTemplateParamRuleSet is request schema for complex param

type CreateAlertStrategyTemplateRequest

type CreateAlertStrategyTemplateRequest struct {
	request.CommonBase

	// 告警模板名称。最大长度64个字符
	Name *string `required:"true"`

	// 产品类型。参考ListMonitorProduct获取监控对象类型列表
	ProductKey *string `required:"true"`

	// 备注
	Remark *string `required:"false"`

	//
	RuleSet []CreateAlertStrategyTemplateParamRuleSet `required:"false"`
}

CreateAlertStrategyTemplateRequest is request schema for CreateAlertStrategyTemplate action

type CreateAlertStrategyTemplateResponse

type CreateAlertStrategyTemplateResponse struct {
	response.CommonBase

	// 创建告警模板返回对象
	Data AlertTemplate
}

CreateAlertStrategyTemplateResponse is response schema for CreateAlertStrategyTemplate action

type DelAlertTemplate

type DelAlertTemplate struct {

	// 模板ID
	TemplateID []int
}

DelAlertTemplate - 删除告警模型返回对象

type DeleteAlertStrategyTemplateRequest

type DeleteAlertStrategyTemplateRequest struct {
	request.CommonBase

	// 告警模板ID(支持批量删除)
	TemplateID []int `required:"true"`
}

DeleteAlertStrategyTemplateRequest is request schema for DeleteAlertStrategyTemplate action

type DeleteAlertStrategyTemplateResponse

type DeleteAlertStrategyTemplateResponse struct {
	response.CommonBase

	// 删除告警模板返回对象
	Data DelAlertTemplate
}

DeleteAlertStrategyTemplateResponse is response schema for DeleteAlertStrategyTemplate action

type GetProductMetricsRequest

type GetProductMetricsRequest struct {
	request.CommonBase

	// 云产品key 例如 uhost
	ProductKey *string `required:"true"`
}

GetProductMetricsRequest is request schema for GetProductMetrics action

type GetProductMetricsRespData

type GetProductMetricsRespData struct {

	// 指标列表
	List []Metirc

	// 查询结果总数
	Total int

	// 单位转换信息
	UnitConfigs []MetricUnitConfig
}

GetProductMetricsRespData - 产品指标查询结果

type GetProductMetricsResponse

type GetProductMetricsResponse struct {
	response.CommonBase

	// 返回数据
	Data GetProductMetricsRespData
}

GetProductMetricsResponse is response schema for GetProductMetrics action

type ListAlertRecordParamFilter

type ListAlertRecordParamFilter struct {

	// 告警级别,根据告警级别精确搜索对应的告警记录
	Levels []string `required:"false"`

	// 产品类型,根据产品类型精确搜索对应的告警记录
	ProductTypes []int `required:"false"`

	// 告警状态,根据告警状态精确搜索对应的告警记录
	Status []string `required:"false"`
}

ListAlertRecordParamFilter is request schema for complex param

type ListAlertRecordRequest

type ListAlertRecordRequest struct {
	request.CommonBase

	// 结束时间,查询告警记录结束时间(查询开始时间和结束时间不能超过一个月)
	EndAt *int `required:"true"`

	//
	Filter *ListAlertRecordParamFilter `required:"false"`

	// 模糊查询(支持资源id模糊搜索)
	Fuzzy *string `required:"false"`

	// 查询返回数量,默认值300,最大值:300。
	Limit *int `required:"false"`

	// 数据偏移量 (默认0)
	Offset *int `required:"false"`

	// 排序(默认根据告警发生时间倒序)
	OrderType *string `required:"false"`

	// 开始时间,查询告警记录开始时间(不支持查询距当前时间一年前的数据)
	StartAt *int `required:"true"`
}

ListAlertRecordRequest is request schema for ListAlertRecord action

type ListAlertRecordResponse

type ListAlertRecordResponse struct {
	response.CommonBase

	// 告警记录集合
	Data []AlertRecord

	// 告警记录总数
	TotalCount int
}

ListAlertRecordResponse is response schema for ListAlertRecord action

type ListAlertStrategyParamFilter

type ListAlertStrategyParamFilter struct {

	// 产品类型,根据产品类型精确搜索对应的告警策略
	ProductTypes []int `required:"false"`

	// 告警策略状态,根据告警策略状态精确搜索对应的告警策略
	Status []int `required:"false"`
}

ListAlertStrategyParamFilter is request schema for complex param

type ListAlertStrategyRequest

type ListAlertStrategyRequest struct {
	request.CommonBase

	//
	Filter *ListAlertStrategyParamFilter `required:"false"`

	// 模糊查询(支持告警策略名称模糊搜索)
	Fuzzy *string `required:"false"`

	// 查询返回数量,默认值300,最大值:300。
	Limit *int `required:"false"`

	// 数据偏移量 (默认0)
	Offset *int `required:"false"`
}

ListAlertStrategyRequest is request schema for ListAlertStrategy action

type ListAlertStrategyResponse

type ListAlertStrategyResponse struct {
	response.CommonBase

	// 告警策略集合
	Data []AlertStrategy

	// 错误信息
	Message string

	// 告警策略总数
	TotalCount int

	// 链路ID
	TraceId string
}

ListAlertStrategyResponse is response schema for ListAlertStrategy action

type ListMonitorProduct

type ListMonitorProduct struct {

	// 查询结果列表
	List []Product

	// 查询结果总数
	Total int
}

ListMonitorProduct -

type ListMonitorProductRequest

type ListMonitorProductRequest struct {
	request.CommonBase
}

ListMonitorProductRequest is request schema for ListMonitorProduct action

type ListMonitorProductResponse

type ListMonitorProductResponse struct {
	response.CommonBase

	// 返回数据
	Data ListMonitorProduct

	// 错误信息
	Message string

	// 链路ID
	TraceId string
}

ListMonitorProductResponse is response schema for ListMonitorProduct action

type Metirc

type Metirc struct {

	// 创建时间
	CreatedAt string

	// 创建者
	CreatedBy string

	// 上报频率毫秒
	FrequencyMs int

	// 指标唯一标识 (uhost_cpu_usage)
	Metric string

	// 指标中文描述
	MetricChDesc string

	// 指标中文名称
	MetricChName string

	// 指标英文描述
	MetricEnDesc string

	// 指标英文名称
	MetricEnName string

	// 指标分类/指标组
	MetricGroup string

	// 指标ID
	MetricID int

	// 云产品ID
	ProductType int

	// 单位
	Unit MetricUnit

	// 单位ID
	UnitID int

	// 修改时间
	UpdatedAt string

	// 修改者
	UpdatedBy string
}

Metirc - 指标

type MetricResult

type MetricResult struct {

	// 资源的短id
	ResourceId string

	// TagMap是一个对象,key和value均为字符串。TagMap返回当前series的所有的tag的key和value。
	TagMap string

	//
	Values []MetricSample
}

MetricResult - 指标查询结果

type MetricSample

type MetricSample struct {

	// 时间戳
	Timestamp float64

	// 样本值
	Value float64
}

MetricSample - 指标样本点模型

type MetricSingleSample

type MetricSingleSample struct {

	// 指标名
	Metric string

	// 指标的tag的k-v对象
	Tags string

	// 指标单个样本点对象
	Value MetricSample
}

MetricSingleSample - 指标单个样本点结果

type MetricUnit

type MetricUnit struct {

	// 转换因子
	ConversionFactor int

	// 创建时间
	CreatedAt string

	// 创建人
	CreatedBy string

	// 删除时间
	DeletedAt int

	// GroupId
	GroupId int

	// 单位中文名称
	UnitChName string

	// 单位描述
	UnitDesc string

	// 单位英文名称
	UnitEnName string

	// 单位id
	UnitID int

	// 修改时间
	UpdatedAt string

	// 修改人
	UpdatedBy string
}

MetricUnit - 指标单位

type MetricUnitConfig

type MetricUnitConfig struct {

	// 转换因子
	ConversionFactor int

	// 转换规则
	ConversionRules []ConversionRule

	// 指标中文名列表
	UnitCnNames []string

	// 指标英文名列表
	UnitEnNames []string
}

MetricUnitConfig - 指标单位配置

type Product

type Product struct {

	// ID
	Id int

	// {Type: 1|2, Key:string, Name: string}[] -> JSON字符串
	Metas string

	// 产品中文名称
	ProductChName string

	// 产品英文名称
	ProductEnName string

	// 产品分组
	ProductGroup string

	// 资源类型唯一key
	ProductKey string

	// 产品名称
	ProductName string

	// 产品子名称
	ProductName1 string

	// 资源类型ID
	ProductType int
}

Product - 云产品

type QueryMetricDataResp

type QueryMetricDataResp struct {

	// 查询的结果集
	List []QueryMetricDataRespItem
}

QueryMetricDataResp - QueryMetricData接口返回的结果

type QueryMetricDataRespItem

type QueryMetricDataRespItem struct {

	// 指标名
	Metric string

	//
	Results []MetricResult

	// 指标查询结果的所有tag的key和对应的所有value数组。Tags格式为,key为tagkey字符串,value为tagValue的字符串数组。
	Tags string
}

QueryMetricDataRespItem - QueryMetricData接口返回结果集的元素模型

type QueryMetricDataSetParamMetricInfos

type QueryMetricDataSetParamMetricInfos struct {

	// 指标名
	Metric *string `required:"true"`

	// 指标所属资源id
	ResourceId *string `required:"true"`

	//
	TagList []QueryMetricDataSetParamMetricInfosTagList `required:"false"`
}

QueryMetricDataSetParamMetricInfos is request schema for complex param

type QueryMetricDataSetParamMetricInfosTagList

type QueryMetricDataSetParamMetricInfosTagList struct {

	// 要查询指标的Tag的key
	TagKey *string `required:"false"`

	// 要查询指标的Tag的Value
	TagValues []string `required:"false"`
}

QueryMetricDataSetParamMetricInfosTagList is request schema for complex param

type QueryMetricDataSetRequest

type QueryMetricDataSetRequest struct {
	request.CommonBase

	// 计算方式,枚举值如下:raw:原始值,max:最大值,min:最小值,avg:平均值,sum:求和
	CalcMethod *string `required:"true"`

	// 截止时间
	EndTime *int `required:"true"`

	//
	MetricInfos []QueryMetricDataSetParamMetricInfos `required:"false"`

	// 周期即:数据查询时,后端上报数据点的频率,选择不同的自定义时间范围,对应的周期不同:0<时间范围<=1h——周期:1分钟/5分钟1h<时间范围<=3h——周期:1分钟/5分钟/1小时3h<时间范围<=24h——周期:5分钟/1小时1天<时间范围<=30天——周期:1小时/6小时/24小时需将周期转化为单位为秒的数值,传入参数
	Period *int `required:"true"`

	// 资源类型
	ProductKey *string `required:"true"`

	// 开始时间
	StartTime *int `required:"true"`
}

QueryMetricDataSetRequest is request schema for QueryMetricDataSet action

type QueryMetricDataSetResponse

type QueryMetricDataSetResponse struct {
	response.CommonBase

	// QueryMetricDataResp
	Data QueryMetricDataResp

	// 错误信息
	Message string

	// 日志链路id
	TraceId string
}

QueryMetricDataSetResponse is response schema for QueryMetricDataSet action

type QueryMetricDataSummaryRequest

type QueryMetricDataSummaryRequest struct {
	request.CommonBase

	// 当前页数据尺寸
	Limit *int `required:"true"`

	// 指定要查询的指标列表,不指定则使用默认的指标集合
	Metrics []string `required:"false"`

	// 跳过的数量
	Offset *int `required:"true"`

	// 产品类型
	ProductKey *string `required:"true"`

	// 指定要查询的资源ID列表
	ResourceIds []string `required:"false"`
}

QueryMetricDataSummaryRequest is request schema for QueryMetricDataSummary action

type QueryMetricDataSummaryRespData

type QueryMetricDataSummaryRespData struct {

	// 结果集
	List []ResourceSummary

	// 总数
	Total int
}

QueryMetricDataSummaryRespData - QueryMetricDataSummary接口返回的Data数据

type QueryMetricDataSummaryResponse

type QueryMetricDataSummaryResponse struct {
	response.CommonBase

	// 数据
	Data QueryMetricDataSummaryRespData

	// 错误信息
	Message string

	// 总数
	TotalCount int

	// 链路id
	TraceId string
}

QueryMetricDataSummaryResponse is response schema for QueryMetricDataSummary action

type ResourceMonitorItem

type ResourceMonitorItem struct {

	// 指标名
	Metric string

	// 指标数据数组
	MetricValues []MetricSingleSample
}

ResourceMonitorItem - 资源监控的单个指标数据

type ResourceSummary

type ResourceSummary struct {

	// 公司id
	CompanyId int

	// 资源的各项指标当前值,类型为:map[string][]MetricSingleSamplemap的key为指标名,value为样本点数组。
	MonitorAttr []ResourceMonitorItem

	// 资源名称
	Name string

	// 项目id
	OrganizationId int

	// 产品类型
	ProductKey string

	// 项目id
	ProjectId int

	// 地域
	Region string

	// 地域中文名
	RegionCN string

	// 资源id
	ResourceId string

	// 资源状态
	Status int

	// 可用区
	Zone string

	// 可用区中文
	ZoneCN string
}

ResourceSummary - 单个资源的总览属性指标等信息

type UnBindAlertStrategyRequest

type UnBindAlertStrategyRequest struct {
	request.CommonBase

	// 告警策略数组
	AlertStrategyIDs []int `required:"true"`

	// 产品类型名称
	ProductKey *string `required:"true"`

	// 资源数组
	Resources []string `required:"true"`
}

UnBindAlertStrategyRequest is request schema for UnBindAlertStrategy action

type UnBindAlertStrategyResponse

type UnBindAlertStrategyResponse struct {
	response.CommonBase
}

UnBindAlertStrategyResponse is response schema for UnBindAlertStrategy action

Jump to

Keyboard shortcuts

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