Skip to content

Commit

Permalink
release 0.0.20-beta source code for go
Browse files Browse the repository at this point in the history
  • Loading branch information
Huaweicloud-SDK committed Nov 2, 2020
1 parent 428654c commit 8733c59
Show file tree
Hide file tree
Showing 96 changed files with 635 additions and 598 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 0.0.20-beta 2020-11-02
## HuaweiCloud SDK CES
- ### Features
- None
- ### Bug Fix
- None
- ### Change
- Interface adjustment: property `alarm_type` in class `CreateAlarmRequestBody` support key `RESOURCE_GROUP`.
- Interface adjustment: property `meta_data` in class `ListAlarmHistoriesResponse` only returns total number of alarm histories.

## HuaweiCloud SDK ELB
- ### Features
- None
- ### Bug Fix
- Modify wrong parameter in class `CreateL7ruleRequestBody`.
- ### Change
- None


## 0.0.19-beta 2020-10-31
## HuaweiCloud SDK Core
- ### Features
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 0.0.20-beta 2020-11-02
## HuaweiCloud SDK CES
- ### 新增特性
-
- ### 解决问题
-
- ### 特性变更
- 创建告警规则接口增加资源分组字段
- 查询告警历史接口响应体metadata修改,只返回total字段

## HuaweiCloud SDK ELB
- ### 新增特性
-
- ### 解决问题
- 创建转发规则接口参数名错误问题修复
- ### 特性变更
-

## 0.0.19-beta 2020-10-31
## HuaweiCloud SDK Core
- ### 新增特性
Expand Down
2 changes: 1 addition & 1 deletion services/ces/v1/ces_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (c *CesClient) CreateAlarm(request *model.CreateAlarmRequest) (*model.Creat
}
}

//批量查询指定时间范围内指定指标的指定粒度的监控数据,目前最多支持10指标的批量查询
//创建自定义告警模板
func (c *CesClient) CreateAlarmTemplate(request *model.CreateAlarmTemplateRequest) (*model.CreateAlarmTemplateResponse, error) {
requestDef := GenReqDefForCreateAlarmTemplate()

Expand Down
2 changes: 1 addition & 1 deletion services/ces/v1/model/model_alarm_template_condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type AlarmTemplateCondition struct {
// 数据的单位,最大长度为32位。
Unit *string `json:"unit,omitempty"`
// 告警阈值,取值范围[0, Number.MAX_VALUE],Number.MAX_VALUE值为1.7976931348623157e+108。具体阈值取值请参见附录中各服务监控指标中取值范围,如支持监控的服务列表中ECS的CPU使用率cpu_util取值范围可配置80。
Value int32 `json:"value"`
Value float64 `json:"value"`
// 发送告警的周期,值可为0, 300, 600, 900, 1800, 3600, 10800, 21600, 43200, 86400;0表示只告警一次,300表示每5分钟告警一次,600表示每10分钟告警一次,900表示每15分钟告警一次,1800表示每30分钟告警一次,3600表示每1小时告警一次,10800表示每3小时告警一次,21600表示每6小时告警一次,43200表示每12小时告警一次,86400表示每1天告警一次。
SuppressDuration *int32 `json:"suppress_duration,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion services/ces/v1/model/model_condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Condition struct {
// 数据的单位,最大长度为32位。
Unit *string `json:"unit,omitempty"`
// 告警阈值,取值范围[0, Number.MAX_VALUE],Number.MAX_VALUE值为1.7976931348623157e+108。具体阈值取值请参见附录中各服务监控指标中取值范围,如支持监控的服务列表中ECS的CPU使用率cpu_util取值范围可配置80。
Value int32 `json:"value"`
Value float64 `json:"value"`
}

func (o Condition) String() string {
Expand Down
16 changes: 10 additions & 6 deletions services/ces/v1/model/model_create_alarm_request_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ type CreateAlarmRequestBody struct {
// 告警名称,只能包含0-9/a-z/A-Z/_/-或汉字。
AlarmName string `json:"alarm_name"`
// 告警描述,长度0-256。
AlarmDescription *string `json:"alarm_description,omitempty"`
Metric *MetricInfoExt `json:"metric"`
Condition *Condition `json:"condition"`
AlarmDescription *string `json:"alarm_description,omitempty"`
Metric *MetricInfoForAlarm `json:"metric"`
Condition *Condition `json:"condition"`
// 是否启用该条告警,默认为true。
AlarmEnabled *bool `json:"alarm_enabled,omitempty"`
// 是否启用该条告警触发的动作,默认为true。注:若alarm_action_enabled为true,对应的alarm_actions、ok_actions至少有一个不能为空。若alarm_actions、ok_actions同时存在时,notificationList值保持一致。
AlarmActionEnabled *bool `json:"alarm_action_enabled,omitempty"`
// 告警级别,默认为2,级别为1、2、3、4。分别对应紧急、重要、次要、提示。
AlarmLevel *int32 `json:"alarm_level,omitempty"`
// 告警类型。 仅针对事件告警的参数,枚举类型:EVENT.SYS或者EVENT.CUSTOM
// 告警类型,支持的枚举类型:EVENT.SYS:针对系统事件的告警规则;EVENT.CUSTOM:针对自定义事件的告警规则;RESOURCE_GROUP:针对资源分组的告警规则。
AlarmType *CreateAlarmRequestBodyAlarmType `json:"alarm_type,omitempty"`
// 告警触发的动作。 结构样例如下: { \"type\": \"notification\",\"notificationList\": [\"urn:smn:southchina:68438a86d98e427e907e0097b7e35d47:sd\"] } type取值: notification:通知。 autoscaling:弹性伸缩。
AlarmActions *[]AlarmActions `json:"alarm_actions,omitempty"`
Expand All @@ -50,8 +50,9 @@ type CreateAlarmRequestBodyAlarmType struct {
}

type CreateAlarmRequestBodyAlarmTypeEnum struct {
EVENT_SYS CreateAlarmRequestBodyAlarmType
EVENT_CUSTOM CreateAlarmRequestBodyAlarmType
EVENT_SYS CreateAlarmRequestBodyAlarmType
EVENT_CUSTOM CreateAlarmRequestBodyAlarmType
RESOURCE_GROUP CreateAlarmRequestBodyAlarmType
}

func GetCreateAlarmRequestBodyAlarmTypeEnum() CreateAlarmRequestBodyAlarmTypeEnum {
Expand All @@ -62,6 +63,9 @@ func GetCreateAlarmRequestBodyAlarmTypeEnum() CreateAlarmRequestBodyAlarmTypeEnu
EVENT_CUSTOM: CreateAlarmRequestBodyAlarmType{
value: "EVENT.CUSTOM",
},
RESOURCE_GROUP: CreateAlarmRequestBodyAlarmType{
value: "RESOURCE_GROUP",
},
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import (

// 创建自定义告警模板请求参数。
type CreateAlarmTemplateRequestBody struct {
// 自定义告警模板名称,只能包含0-9/a-z/A-Z/_/-或汉字。
// 自定义告警模板名称,只能包含0-9/a-z/A-Z/_/-或汉字,长度为1-128。
TemplateName string `json:"template_name"`
// 自定义告警模板详细描述,长度为0-256。
TemplateDescription *string `json:"template_description,omitempty"`
// 创建自定义告警模板选择的资源类型,即服务命名空间,如:选择弹性云服务器,则命名空间为SYS.ECS
// 创建自定义告警模板选择的资源类型,即服务命名空间,如:选择弹性云服务器,则命名空间为SYS.ECS
Namespace string `json:"namespace"`
// 资源类型对应的指标监控维度,选择弹性云服务器,则维度为云服务器,dimension_name值为instance_id
// 资源类型对应的指标监控维度,选择弹性云服务器,则维度为云服务器,dimension_name值为instance_id
DimensionName string `json:"dimension_name"`
// 创建自定义告警模板添加添加一个或者多个指标的告警规则;目前最多可增加30组告警规则策略。
// 创建自定义告警模板添加添加一个或者多个指标的告警规则;目前最多可增加30组告警规则策略。
TemplateItems []TemplateItem `json:"template_items"`
}

Expand Down
4 changes: 2 additions & 2 deletions services/ces/v1/model/model_list_alarm_histories_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
// Response Object
type ListAlarmHistoriesResponse struct {
// 一条或者多条告警历史详细信息
AlarmHistories *[]AlarmHistoryInfo `json:"alarm_histories,omitempty"`
MetaData *MetaData `json:"meta_data,omitempty"`
AlarmHistories *[]AlarmHistoryInfo `json:"alarm_histories,omitempty"`
MetaData *MetaDataForAlarmHistory `json:"meta_data,omitempty"`
}

func (o ListAlarmHistoriesResponse) String() string {
Expand Down
25 changes: 25 additions & 0 deletions services/ces/v1/model/model_meta_data_for_alarm_history.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* CES
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
*/

package model

import (
"encoding/json"

"strings"
)

// 查询告警历史返回的总条数。
type MetaDataForAlarmHistory struct {
// 查询告警历史返回的总条数。
Total int32 `json:"total"`
}

func (o MetaDataForAlarmHistory) String() string {
data, _ := json.Marshal(o)
return strings.Join([]string{"MetaDataForAlarmHistory", string(data)}, " ")
}
29 changes: 0 additions & 29 deletions services/ces/v1/model/model_metric_info_ext.go

This file was deleted.

2 changes: 1 addition & 1 deletion services/ces/v1/model/model_metric_info_for_alarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
)

// 创建规则中的监控信息
// 创建规则中的监控指标信息
type MetricInfoForAlarm struct {
// 指标维度
Dimensions []MetricsDimension `json:"dimensions"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import (

// 修改自定义告警模板,请求参数
type UpdateAlarmTemplateRequestBody struct {
// 自定义告警模板名称,只能包含0-9/a-z/A-Z/_/-或汉字。
// 自定义告警模板名称,只能包含0-9/a-z/A-Z/_/-或汉字,长度为1-128。
TemplateName string `json:"template_name"`
// 自定义告警模板详细描述,长度为0-256。
TemplateDescription *string `json:"template_description,omitempty"`
// 创建自定义告警模板选择的资源类型,即服务命名空间,如:选择弹性云服务器,则命名空间为SYS.ECS
// 创建自定义告警模板选择的资源类型,即服务命名空间,如:选择弹性云服务器,则命名空间为SYS.ECS
Namespace string `json:"namespace"`
// 资源类型对应的指标监控维度,选择弹性云服务器,则维度为云服务器,dimension_name值为instance_id
// 资源类型对应的指标监控维度,选择弹性云服务器,则维度为云服务器,dimension_name值为instance_id
DimensionName string `json:"dimension_name"`
// 创建自定义告警模板添加添加一个或者多个指标的告警规则;目前最多可增加30组告警规则策略。
// 创建自定义告警模板添加添加一个或者多个指标的告警规则;目前最多可增加30组告警规则策略。
TemplateItems []TemplateItem `json:"template_items"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// 证书接口增删改查响应体
type CertificateV2Resp struct {
type CertificateResp struct {
// SSL证书id
Id string `json:"id"`
// SSL证书所在的项目ID
Expand All @@ -27,7 +27,7 @@ type CertificateV2Resp struct {
// SSL证书的描述。
Description string `json:"description"`
// SSL证书的类型。分为服务器证书(server)和CA证书(client)。
Type CertificateV2RespType `json:"type"`
Type CertificateRespType `json:"type"`
// 服务器证书所签域名。该字段仅type为server时有效。
Domain string `json:"domain"`
// 服务器证书的私钥。仅type为server时有效。type为server时必选。
Expand All @@ -42,36 +42,36 @@ type CertificateV2Resp struct {
UpdateTime string `json:"update_time"`
}

func (o CertificateV2Resp) String() string {
func (o CertificateResp) String() string {
data, _ := json.Marshal(o)
return strings.Join([]string{"CertificateV2Resp", string(data)}, " ")
return strings.Join([]string{"CertificateResp", string(data)}, " ")
}

type CertificateV2RespType struct {
type CertificateRespType struct {
value string
}

type CertificateV2RespTypeEnum struct {
SERVER CertificateV2RespType
CLIENT CertificateV2RespType
type CertificateRespTypeEnum struct {
SERVER CertificateRespType
CLIENT CertificateRespType
}

func GetCertificateV2RespTypeEnum() CertificateV2RespTypeEnum {
return CertificateV2RespTypeEnum{
SERVER: CertificateV2RespType{
func GetCertificateRespTypeEnum() CertificateRespTypeEnum {
return CertificateRespTypeEnum{
SERVER: CertificateRespType{
value: "server",
},
CLIENT: CertificateV2RespType{
CLIENT: CertificateRespType{
value: "client",
},
}
}

func (c CertificateV2RespType) MarshalJSON() ([]byte, error) {
func (c CertificateRespType) MarshalJSON() ([]byte, error) {
return json.Marshal(c.value)
}

func (c *CertificateV2RespType) UnmarshalJSON(b []byte) error {
func (c *CertificateRespType) UnmarshalJSON(b []byte) error {
myConverter := converter.StringConverterFactory("string")
if myConverter != nil {
val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\""))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// 创建健康检查请求
type CreateHealthmonitorV2Req struct {
type CreateHealthmonitorReq struct {
// 健康检查所在的项目ID。
TenantId *string `json:"tenant_id,omitempty"`
// 健康检查名称。
Expand All @@ -27,7 +27,7 @@ type CreateHealthmonitorV2Req struct {
// 健康检查的超时时间。建议该值小于delay的值。
Timeout int32 `json:"timeout"`
// 健康检查类型
Type CreateHealthmonitorV2ReqType `json:"type"`
Type CreateHealthmonitorReqType `json:"type"`
// 期望HTTP响应状态码,指定下列值:单值,例如200;列表,例如200,202;区间,例如200-204。仅当type为HTTP时生效。该字段为预留字段,暂未启用。
ExpectedCodes *string `json:"expected_codes,omitempty"`
// 功能说明:健康检查测试member健康状态时,发送的http请求的域名。仅当type为HTTP时生效。使用说明:默认为空,表示使用负载均衡器的vip作为http请求的目的地址。以数字或字母开头,只能包含数字、字母、’-’、’.’。
Expand All @@ -44,40 +44,40 @@ type CreateHealthmonitorV2Req struct {
PoolId string `json:"pool_id"`
}

func (o CreateHealthmonitorV2Req) String() string {
func (o CreateHealthmonitorReq) String() string {
data, _ := json.Marshal(o)
return strings.Join([]string{"CreateHealthmonitorV2Req", string(data)}, " ")
return strings.Join([]string{"CreateHealthmonitorReq", string(data)}, " ")
}

type CreateHealthmonitorV2ReqType struct {
type CreateHealthmonitorReqType struct {
value string
}

type CreateHealthmonitorV2ReqTypeEnum struct {
TCP CreateHealthmonitorV2ReqType
UDP_CONNECT CreateHealthmonitorV2ReqType
HTTP CreateHealthmonitorV2ReqType
type CreateHealthmonitorReqTypeEnum struct {
TCP CreateHealthmonitorReqType
UDP_CONNECT CreateHealthmonitorReqType
HTTP CreateHealthmonitorReqType
}

func GetCreateHealthmonitorV2ReqTypeEnum() CreateHealthmonitorV2ReqTypeEnum {
return CreateHealthmonitorV2ReqTypeEnum{
TCP: CreateHealthmonitorV2ReqType{
func GetCreateHealthmonitorReqTypeEnum() CreateHealthmonitorReqTypeEnum {
return CreateHealthmonitorReqTypeEnum{
TCP: CreateHealthmonitorReqType{
value: "TCP",
},
UDP_CONNECT: CreateHealthmonitorV2ReqType{
UDP_CONNECT: CreateHealthmonitorReqType{
value: "UDP_CONNECT",
},
HTTP: CreateHealthmonitorV2ReqType{
HTTP: CreateHealthmonitorReqType{
value: "HTTP",
},
}
}

func (c CreateHealthmonitorV2ReqType) MarshalJSON() ([]byte, error) {
func (c CreateHealthmonitorReqType) MarshalJSON() ([]byte, error) {
return json.Marshal(c.value)
}

func (c *CreateHealthmonitorV2ReqType) UnmarshalJSON(b []byte) error {
func (c *CreateHealthmonitorReqType) UnmarshalJSON(b []byte) error {
myConverter := converter.StringConverterFactory("string")
if myConverter != nil {
val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\""))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

// This is a auto create Body Object
type CreateHealthmonitorRequestBody struct {
Healthmonitor *CreateHealthmonitorV2Req `json:"healthmonitor"`
Healthmonitor *CreateHealthmonitorReq `json:"healthmonitor"`
}

func (o CreateHealthmonitorRequestBody) String() string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

// Response Object
type CreateHealthmonitorResponse struct {
Healthmonitor *HealthmonitorV2Resp `json:"healthmonitor,omitempty"`
Healthmonitor *HealthmonitorResp `json:"healthmonitor,omitempty"`
}

func (o CreateHealthmonitorResponse) String() string {
Expand Down
Loading

0 comments on commit 8733c59

Please sign in to comment.