-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Arisu Tachibana <[email protected]>
- Loading branch information
1 parent
febd12e
commit 92fcab0
Showing
5 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
import json | ||
import pprint | ||
|
||
import click | ||
import requests | ||
import toml | ||
from git import Repo | ||
|
||
|
||
def api_connection(host): | ||
click.secho("api connect: " + host, fg="green") | ||
return host | ||
|
||
|
||
def get_node(url, nodeid): | ||
headers = { | ||
"Content-Type": "application/json; charset=utf-8", | ||
} | ||
url = url + "/node/" + nodeid | ||
click.secho(url) | ||
response = requests.get(url, headers=headers) | ||
click.secho(response.status_code, fg="green") | ||
click.secho(pprint.pprint(response.json()), fg="green") | ||
|
||
|
||
@click.command(help="Get results") | ||
@click.option( | ||
"--nodeid", | ||
required=True, | ||
help="select node_id", | ||
) | ||
@click.pass_context | ||
def results(ctx, nodeid): | ||
config = ctx.obj.get("CFG") | ||
instance = ctx.obj.get("INSTANCE") | ||
url = api_connection(config[instance]["host"]) | ||
get_node(url, nodeid) | ||
|
||
|
||
if __name__ == "__main__": | ||
main_kcidev() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters