Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add maintain/reset api #144

Merged
merged 4 commits into from Jul 5, 2017
Merged

Conversation

milkwine
Copy link
Contributor

try to add maintain/reset api

Error will occur when get hostgroup info by id:

  sql: Scan error on column index 5: converting driver.Value type int64 ("1497951907") to a uint16: value out of range

//maintain
hostr.POST("/host/maintain", SetMaintain)
hostr.POST("/host/reset", UnsetMaintain)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hostr.DELETE("/host/maintain", UnsetMaintain)

用这个url更清晰

```
{
"ids": [1,2,3,4],
"maintain_begin": 1497951907,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里fmt一下缩进格式吧:)

MaintainBegin uint16 `json:"maintain_begin" gorm:"column:maintain_begin"`
MaintainEnd uint16 `json:"maintain_end" gorm:"column:maintain_end"`
MaintainBegin int64 `json:"maintain_begin" gorm:"column:maintain_begin"`
MaintainEnd int64 `json:"maintain_end" gorm:"column:maintain_end"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么要修改为int64呢:)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error will occur when get hostgroup info by id:

sql: Scan error on column index 5: converting driver.Value type int64 ("1497951907") to a uint16: value out of range

编译环境: centos 6 + golang 1.8.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

接口里的维护时间拿不出来

@masato25
Copy link
Member

masato25 commented Jul 4, 2017

新加上api看起来没有什么问题
MaintainBegin , MaintainEnd 改成int64的理由ok!

@sawater 就是文件format的问题, 你修正一下吧.

@masato25 masato25 merged commit c25c45c into open-falcon:master Jul 5, 2017
@milkwine milkwine deleted the add_api_maintain branch March 14, 2018 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants