models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: Apache-2.0 Imports: 0 Imported by: 12 modules, 20 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alarm

type Alarm struct {

	/* 统计方法:平均值=avg、最大值=max、最小值=min (Optional) */
	Calculation string `json:"calculation"`

	/*  (Optional) */
	ContactGroups []string `json:"contactGroups"`

	/*  (Optional) */
	ContactPersons []string `json:"contactPersons"`

	/*  (Optional) */
	CreateTime string `json:"createTime"`

	/* 启用禁用 1启用,0禁用 (Optional) */
	Enabled int64 `json:"enabled"`

	/* 规则id (Optional) */
	Id string `json:"id"`

	/* 监控项 (Optional) */
	Metric string `json:"metric"`

	/* 规则id监控项名称 (Optional) */
	MetricName string `json:"metricName"`

	/* 通知周期 单位:小时 (Optional) */
	NoticePeriod int64 `json:"noticePeriod"`

	/*  (Optional) */
	NoticeTime string `json:"noticeTime"`

	/* >=、>、<、<=、=、!= (Optional) */
	Operation string `json:"operation"`

	/* 统计周期(单位:分钟) (Optional) */
	Period int64 `json:"period"`

	/* 地域信息 (Optional) */
	Region string `json:"region"`

	/* 此规则所应用的资源id (Optional) */
	ResourceId string `json:"resourceId"`

	/* 报警规则对应的产品 (Optional) */
	ServiceCode string `json:"serviceCode"`

	/* 监控项状态:1正常,2告警,4数据不足 (Optional) */
	Status int64 `json:"status"`

	/* 监控项附属信息 (Optional) */
	Tag string `json:"tag"`

	/* 阈值 (Optional) */
	Threshold float64 `json:"threshold"`

	/* 连续多少次后报警 (Optional) */
	Times int64 `json:"times"`

	/* 报警值 (Optional) */
	Value float64 `json:"value"`
}

type AlarmHistory

type AlarmHistory struct {

	/* 统计方法:平均值=avg、最大值=max、最小值=min (Optional) */
	Calculation string `json:"calculation"`

	/* 通知的联系组,如 [“联系组1”,”联系组2”] (Optional) */
	ContactGroups []string `json:"contactGroups"`

	/* 通知的联系人,如 [“联系人1”,”联系人2”] (Optional) */
	ContactPersons []string `json:"contactPersons"`

	/* 该规则是否已经被删除,1表示已经被删除,0表示未删除,被删除的规则,在使用查询规则的接口时,将不会被检索到 (Optional) */
	Deleted int `json:"deleted"`

	/* 启用禁用 1启用,0禁用 (Optional) */
	Enabled int `json:"enabled"`

	/* 规则id (Optional) */
	Id string `json:"id"`

	/* 监控项 (Optional) */
	Metric string `json:"metric"`

	/* 规则id监控项名称 (Optional) */
	MetricName string `json:"metricName"`

	/* 通知周期 单位:小时 (Optional) */
	NoticePeriod int `json:"noticePeriod"`

	/* 报警的时间 (Optional) */
	NoticeTime string `json:"noticeTime"`

	/* >=、>、<、<=、==、!= (Optional) */
	Operation string `json:"operation"`

	/* 统计周期(单位:分钟) (Optional) */
	Period int `json:"period"`

	/* 地域信息 (Optional) */
	Region string `json:"region"`

	/* 此规则所应用的资源id (Optional) */
	ResourceId string `json:"resourceId"`

	/* 报警规则对应的产品 (Optional) */
	ServiceCode string `json:"serviceCode"`

	/* 监控项附属信息 (Optional) */
	Tag string `json:"tag"`

	/* 阈值 (Optional) */
	Threshold float64 `json:"threshold"`

	/* 连续多少次后报警 (Optional) */
	Times int `json:"times"`

	/* 报警值 (Optional) */
	Value float64 `json:"value"`
}

type BaseContact added in v1.1.1

type BaseContact struct {

	/* 联系人id  */
	ReferenceId int64 `json:"referenceId"`

	/* 联系人id类型:0,联系人分组id;1,联系人id  */
	ReferenceType int64 `json:"referenceType"`
}

type BaseRule added in v1.1.1

type BaseRule struct {

	/* 弹性伸缩组ID (Optional) */
	AutoScalingPolicyId *string `json:"autoScalingPolicyId"`

	/* 单位  */
	CalculateUnit string `json:"calculateUnit"`

	/* 统计方法,必须与定义的metric一致,可选值列表:avg,sum,max,min  */
	Calculation string `json:"calculation"`

	/* 降采样函数  */
	DownSample string `json:"downSample"`

	/* 监控项  */
	Metric string `json:"metric"`

	/*  (Optional) */
	NoticeLevel *NoticeLevel `json:"noticeLevel"`

	/* 通知周期,单位:小时  */
	NoticePeriod int64 `json:"noticePeriod"`

	/* 报警比较符,只能为以下几种lte(<=),lt(<),gt(>),gte(>=),eq(==),ne(!=)  */
	Operation string `json:"operation"`

	/* 查询指标的周期,单位为分钟,目前支持的取值:1,2,5,15,30,60  */
	Period int64 `json:"period"`

	/* 规则类型, 1云监控的规则, 6站点监控。默认为1 (Optional) */
	RuleType *int64 `json:"ruleType"`

	/* 多值标签 (Optional) */
	Tags *interface{} `json:"tags"`

	/* 报警阈值,目前只开放数值类型功能  */
	Threshold float64 `json:"threshold"`

	/* 连续探测几次都满足阈值条件时报警,可选值:1,2,3,5,10,15,30,60  */
	Times int64 `json:"times"`
}

type BatchCreateAlarmsSpec added in v1.1.1

type BatchCreateAlarmsSpec struct {

	/* 幂等性校验参数,最长36位  */
	ClientToken string `json:"clientToken"`

	/* 通知的联系人 (Optional) */
	Contacts []BaseContact `json:"contacts"`

	/* 地域 (Optional) */
	Datacenter string `json:"datacenter"`

	/* 报警规则对应实例列表,每次最多100个,例如"['resourceId1','resourceId2']"  */
	ResourceIds []string `json:"resourceIds"`

	/* 规则类型, 1表示资源监控,6表示站点监控,默认为1 (Optional) */
	RuleType int64 `json:"ruleType"`

	/* 要批量创建的规则列表  */
	Rules []BaseRule `json:"rules"`

	/* 是否保存为模板 (Optional) */
	SaveTemplate bool `json:"saveTemplate"`

	/* 产品线标识,规则对应的serviceCode  */
	ServiceCode string `json:"serviceCode"`

	/* 模板名称,保存模板时,不能为空 (Optional) */
	TemplateName string `json:"templateName"`

	/* 产品线标识,保存为模板时,模板对应的serviceCode (Optional) */
	TemplateServiceCode string `json:"templateServiceCode"`

	/* 回调content 注:仅webHookUrl和webHookContent均不为空时,才会创建webHook (Optional) */
	WebHookContent string `json:"webHookContent"`

	/* webHook协议 (Optional) */
	WebHookProtocol string `json:"webHookProtocol"`

	/* 回调secret,用户请求签名,防伪造 (Optional) */
	WebHookSecret string `json:"webHookSecret"`

	/* 回调url (Optional) */
	WebHookUrl string `json:"webHookUrl"`
}

type BatchSwitchAlarmsSpec added in v1.1.1

type BatchSwitchAlarmsSpec struct {

	/* 告警规则的ID列表  */
	Ids []string `json:"ids"`
}

type CreateAlarmBody

type CreateAlarmBody struct {

	/* 幂等性校验参数,最长32位,值不变则返回值不会变  */
	ClientToken string `json:"clientToken"`

	/*   */
	CreateAlarmSpec CreateAlarmSpec `json:"createAlarmSpec"`
}

type CreateAlarmSpec

type CreateAlarmSpec struct {

	/* 报警规则通知的联系组,必须在控制台上已创建,例如" ['联系组1','联系组2']" (Optional) */
	ContactGroups []string `json:"contactGroups"`

	/* 报警规则通知的联系人,必须在控制台上已创建,例如 [“联系人1”,”联系人2”] (Optional) */
	ContactPersons []string `json:"contactPersons"`

	/* 取样频次 (Optional) */
	DownSample string `json:"downSample"`

	/* 根据产品线查询可用监控项列表 接口 返回的Metric字段  */
	Metric string `json:"metric"`

	/* 通知周期 单位:小时 (Optional) */
	NoticePeriod int64 `json:"noticePeriod"`

	/* 报警规则对应实例列表,每次最多100个,例如"['resourceId1','resourceId2']"  */
	ResourceIds []string `json:"resourceIds"`

	/* 产品名称  */
	ServiceCode string `json:"serviceCode"`

	/* 查询指标的周期,单位为分钟,目前支持的取值:2,5,15,30,60  */
	Threshold float64 `json:"threshold"`

	/* 连续探测几次都满足阈值条件时报警,可选值:1,2,3,5  */
	Times int64 `json:"times"`
}

type DataPoint

type DataPoint struct {

	/*  (Optional) */
	Timestamp int64 `json:"timestamp"`

	/*  (Optional) */
	Value interface{} `json:"value"`
}

type DataPointX added in v1.1.1

type DataPointX struct {

	/* 监控指标名称,长度不超过255字节,只允许英文、数字、下划线_、点.,  [0-9][a-z] [A-Z] [. _ ], 其它会返回err  */
	Metric string `json:"metric"`

	/* 数据维度,数据类型为map类型,最多五个标签,尽量不传或少传。总长度不大于255字节,只允许英文、数字、下划线_、点., [0-9][a-z] [A-Z] [. _ ],  其它会返回err (Optional) */
	Tags interface{} `json:"tags"`

	/* 秒级时间戳,早于当前时间30天的不能写入;建议的上报时间戳:上报时间间隔的整数倍,如上报间隔为5s,则建议上报的时间戳为 timestamp = current timestamp - (current timestamp % time interval) = 1487647187 - (1487647187 % 5) = 1487647187 -2 = 1487647185  */
	Timestamp int64 `json:"timestamp"`

	/* 监控的值。number or string。最大值为long.MAX_VALUE=9223372036854775807=263-1。累计类型的指标,累计到最大值后需要翻转为0,重新开始计数。翻转后不影响速率的计算。  */
	Value interface{} `json:"value"`
}

type DescribedAlarm added in v1.1.1

type DescribedAlarm struct {

	/* 计算单位 (Optional) */
	CalculateUnit string `json:"calculateUnit"`

	/* 统计方法:平均值=avg、最大值=max、最小值=min (Optional) */
	Calculation string `json:"calculation"`

	/* 创建时间 (Optional) */
	CreateTime string `json:"createTime"`

	/* 降采样方法 (Optional) */
	DownSample string `json:"downSample"`

	/* 是否启用 (Optional) */
	Enabled int64 `json:"enabled"`

	/* 报警规则ID (Optional) */
	Id string `json:"id"`

	/* 监控项 (Optional) */
	Metric string `json:"metric"`

	/* 监控项名称 (Optional) */
	MetricName string `json:"metricName"`

	/*  (Optional) */
	NoticeLevel NoticeLevel `json:"noticeLevel"`

	/* 告警周期 (Optional) */
	NoticePeriod int64 `json:"noticePeriod"`

	/* gt, gte, lt, lte, eq, ne (Optional) */
	Operation string `json:"operation"`

	/* 统计周期(单位:分钟) (Optional) */
	Period int64 `json:"period"`

	/* 地域信息 (Optional) */
	Region string `json:"region"`

	/* 资源id (Optional) */
	ResourceId string `json:"resourceId"`

	/* 产品线编码 (Optional) */
	ServiceCode string `json:"serviceCode"`

	/* 监控项状态:1正常,2告警,4数据不足 (Optional) */
	Status int64 `json:"status"`

	/* 标签 (Optional) */
	Tags interface{} `json:"tags"`

	/* 告警阈值 (Optional) */
	Threshold float64 `json:"threshold"`

	/* 告警次数 (Optional) */
	Times int64 `json:"times"`
}

type DescribedAlarmHistory added in v1.1.1

type DescribedAlarmHistory struct {

	/*  (Optional) */
	Alarm DescribedAlarm `json:"alarm"`

	/* 告警联系人 (Optional) */
	Contacts []DescribedNoticeContacts `json:"contacts"`

	/* 触发的告警级别。从低到高分别为‘common’, ‘critical’, ‘fatal’ (Optional) */
	NoticeLevelTriggered string `json:"noticeLevelTriggered"`

	/* 告警时间 (Optional) */
	NoticeTime string `json:"noticeTime"`

	/* 告警值 (Optional) */
	Value float64 `json:"value"`
}

type DescribedNoticeContacts added in v1.1.1

type DescribedNoticeContacts struct {

	/* 联系人ID (Optional) */
	ReferenceId int64 `json:"referenceId"`

	/* 联系人类型。 0 - 联系人分组id, 1 - 联系人id (Optional) */
	ReferenceType int64 `json:"referenceType"`
}

type Err added in v1.1.1

type Err struct {

	/*  (Optional) */
	Code int64 `json:"code"`

	/*  (Optional) */
	Details interface{} `json:"details"`

	/*  (Optional) */
	Message string `json:"message"`

	/*  (Optional) */
	Status string `json:"status"`
}

type ErrorBody

type ErrorBody struct {

	/* 错误码 (Optional) */
	Code int `json:"code"`

	/* 错误信息 (Optional) */
	Message string `json:"message"`

	/* 错误状态 (Optional) */
	Status string `json:"status"`
}

type Filter added in v1.1.1

type Filter struct {

	/*  (Optional) */
	Name *string `json:"name"`

	/*  (Optional) */
	Values []string `json:"values"`
}

type LastDownsampleRespItem added in v1.0.7

type LastDownsampleRespItem struct {

	/*  (Optional) */
	Metric string `json:"metric"`

	/*  (Optional) */
	Name string `json:"name"`

	/*  (Optional) */
	Value interface{} `json:"value"`
}

type Metric

type Metric struct {

	/*  (Optional) */
	Aggregator string `json:"aggregator"`

	/*  (Optional) */
	CalculateUnit string `json:"calculateUnit"`

	/*  (Optional) */
	Metric string `json:"metric"`

	/*  (Optional) */
	MetricName string `json:"metricName"`

	/*  (Optional) */
	Period string `json:"period"`
}

type MetricData

type MetricData struct {

	/*  (Optional) */
	Data []DataPoint `json:"data"`

	/*  (Optional) */
	Metric Metric `json:"metric"`

	/*  (Optional) */
	Tags []Tag `json:"tags"`
}

type MetricDataCm added in v1.0.7

type MetricDataCm struct {

	/* 命名空间 ,长度不超过255字节,只允许英文、数字、下划线_、点., [0-9][a-z] [A-Z] [. _ ],  其它会返回err  */
	Namespace string `json:"namespace"`

	/* 监控指标名称,长度不超过255字节,只允许英文、数字、下划线_、点.,  [0-9][a-z] [A-Z] [. _ ], 其它会返回err  */
	Metric string `json:"metric"`

	/* 数据维度,数据类型为map类型,支持最少一个,最多五个标签,总长度不大于255字节,只允许英文、数字、下划线_、点., [0-9][a-z] [A-Z] [. _ ],  其它会返回err  */
	Dimensions interface{} `json:"dimensions"`

	/* 上报数据点的时间戳,只支持10位,秒级时间戳,不能写入过去30天的时间  */
	Timestamp int64 `json:"timestamp"`

	/* 数据上报类型,1为原始值,2为聚合数据。当上报聚合数据时,建议为60s的周期时行上报、否则无法正常查询  */
	Type int `json:"type"`

	/* 指标值集合,数据类型必须为map类型,key为数据类型,value为数据值,当type=1时,key只能为”value”,上报的是原始值,当type=2时,K的值可以为"avg","sum","last","max","min","count",只支持以上类型,否则会报错,value内容为整型或浮点型数字,最大值为9223372036854775807,count只支持>=0的数  */
	Values interface{} `json:"values"`
}

type MetricDataList added in v1.0.7

type MetricDataList struct {

	/* 错误数据 (Optional) */
	ErrMetricData string `json:"errMetricData"`

	/* 错误数据描述 (Optional) */
	ErrDetail string `json:"errDetail"`
}

type MetricDetail

type MetricDetail struct {

	/* 指标的计算单位,比如bit/s、%、byte等 (Optional) */
	CalculateUnit string `json:"calculateUnit"`

	/* 监控指标英文标识 (Optional) */
	Metric string `json:"metric"`

	/* 监控指标名称 (Optional) */
	MetricName string `json:"metricName"`

	/* 资源类型标识 (Optional) */
	ServiceCode string `json:"serviceCode"`

	/* 取样频次 (Optional) */
	DownSample string `json:"downSample"`
}

type NoticeLevel added in v1.1.1

type NoticeLevel struct {

	/* 是否为用户自己定义的级别,自定义(true) or 固定(false)  */
	Custom bool `json:"custom"`

	/* 报警级别以及对应的指标,common:一般 critial: 严重 fatal:紧急  */
	Levels interface{} `json:"levels"`
}

type PutBody added in v1.1.1

type PutBody struct {

	/* 目前统一用jcloud  */
	AppCode string `json:"appCode"`

	/* 资源的类型,取值vm,ip,database,storage,disk,cdn,redis,balance,nat_gw,db_ro,vpn,ddos等,新接入的产品要求与opentapi命名的产品线名称一致  */
	ServiceCode string `json:"serviceCode"`

	/* 地域信息,如 cn-north-1 等  */
	Region string `json:"region"`

	/* 资源的唯一表示,一般为uuid  */
	ResourceId string `json:"resourceId"`

	/* 监控数据点  */
	DataPoints []DataPointX `json:"dataPoints"`
}

type ServiceCodeMetrics

type ServiceCodeMetrics struct {

	/*  (Optional) */
	Metrics []MetricDetail `json:"metrics"`

	/*  (Optional) */
	ServiceCode string `json:"serviceCode"`
}

type Tag added in v1.1.1

type Tag struct {

	/*  (Optional) */
	TagKey string `json:"tagKey"`

	/*  (Optional) */
	TagValue string `json:"tagValue"`
}

type TagFilter added in v1.0.7

type TagFilter struct {

	/*  (Optional) */
	Key *string `json:"key"`

	/* Tag值 (Optional) */
	Values []string `json:"values"`
}

type TagKeyValue added in v1.1.1

type TagKeyValue struct {

	/* tag键 (Optional) */
	TagKey string `json:"tagKey"`

	/* tag值 (Optional) */
	TagValue string `json:"tagValue"`
}

type Tags added in v1.0.2

type Tags struct {

	/* 标签名  */
	Name string `json:"name"`

	/* 标签值  */
	Value string `json:"value"`
}

type UpdateAlarmBody

type UpdateAlarmBody struct {

	/* 统计方法:平均值=avg、最大值=max、最小值=min、总和=sum  */
	Calculation string `json:"calculation"`

	/* 通知的联系组,如 [“联系组1”,”联系组2”] (Optional) */
	ContactGroups []string `json:"contactGroups"`

	/* 通知的联系人,如 [“联系人1”,”联系人2”] (Optional) */
	ContactPersons []string `json:"contactPersons"`

	/* 取样频次 (Optional) */
	DownSample string `json:"downSample"`

	/* 根据产品线查询可用监控项列表 接口 返回的Metric字段  */
	Metric string `json:"metric"`

	/* 通知周期 单位:小时 (Optional) */
	NoticePeriod int `json:"noticePeriod"`

	/* >=、>、<、<=、==、!=  */
	Operation string `json:"operation"`

	/* 统计周期(单位:分钟),可选值:2,5,15,30,60  */
	Period int `json:"period"`

	/* 产品名称  */
	ServiceCode string `json:"serviceCode"`

	/* 阈值  */
	Threshold float64 `json:"threshold"`

	/* 连续多少次后报警,可选值:1,2,3,5  */
	Times int `json:"times"`
}

type UpdateAlarmResponseEnd added in v1.1.1

type UpdateAlarmResponseEnd struct {

	/* 更新之后的规则id (Optional) */
	AlarmId string `json:"alarmId"`
}

type UpdateAlarmSpec added in v1.1.1

type UpdateAlarmSpec struct {

	/* 通知联系人 (Optional) */
	Contacts []BaseContact `json:"contacts"`

	/*   */
	Rule BaseRule `json:"rule"`

	/* 回调content 注:仅webHookUrl和webHookContent均不为空时,才会创建webHook (Optional) */
	WebHookContent string `json:"webHookContent"`

	/* webHook协议 (Optional) */
	WebHookProtocol string `json:"webHookProtocol"`

	/* 回调secret,用户请求签名,防伪造 (Optional) */
	WebHookSecret string `json:"webHookSecret"`

	/* 回调url (Optional) */
	WebHookUrl string `json:"webHookUrl"`
}

Jump to

Keyboard shortcuts

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