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

调用/api/v1/graph/lastpoint获取last值 #700

Closed
SaltedFishChili opened this issue Mar 6, 2019 · 1 comment
Closed

调用/api/v1/graph/lastpoint获取last值 #700

SaltedFishChili opened this issue Mar 6, 2019 · 1 comment

Comments

@SaltedFishChili
Copy link

SaltedFishChili commented Mar 6, 2019

##must:
Auth Session
Endpoint
Counter

##Simple request of python:

import requests

url = "http://127.0.0.1:8080/api/v1/graph/lastpoint"
payload = "[{ "Endpoint": "host1", "Counter":"cpu.idle" }]" #body必须为数组
headers = {
'apitoken': "{"name":"your_name","sig":"your_sig"}",
'x-forwarded-for': "127.0.0.1",
'content-type': "application/json",
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)

##Response
Status:200

##Response Data
[
{
"endpoint": "host1",
"counter": "cpu.idle",
"value": {
"timestamp": 1551853560,
"value": 95.309973
}
}
]

@SaltedFishChili
Copy link
Author

不支持多key单vaule或单key多vaule的数组,略坑!

@laiwei laiwei closed this as completed Apr 11, 2019
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

No branches or pull requests

2 participants