forked from thunix/thunix_api
Added ipv6 to ip_info
This commit is contained in:
parent
0cec28e3f7
commit
b139fb9782
@ -4,6 +4,9 @@ import psutil
|
||||
class Disk(Resource):
|
||||
def get(self):
|
||||
disk_usage = psutil.disk_usage('/')
|
||||
payload = {"total":disk_usage.total,"used":disk_usage.used,"percentused":disk_usage.percent}
|
||||
payload = {
|
||||
"total":disk_usage.total,
|
||||
"used":disk_usage.used,
|
||||
"percentused":disk_usage.percent
|
||||
}
|
||||
return payload
|
||||
##abort(501, message="Not currently implemented.")
|
||||
|
@ -21,6 +21,7 @@ class IpInfo(Resource):
|
||||
|
||||
def get(self):
|
||||
ipv4 = self.get_ip_addresses(socket.AF_INET)
|
||||
ipv6 = self.get_ip_addresses(socket.AF_INET6)
|
||||
|
||||
payload = [
|
||||
{
|
||||
@ -30,4 +31,7 @@ class IpInfo(Resource):
|
||||
for addr in ipv4:
|
||||
payload[0]["Interfaces"].append(addr)
|
||||
|
||||
for addr in ipv6:
|
||||
payload[0]["Interfaces"].append(addr)
|
||||
|
||||
return payload
|
||||
|
Loading…
Reference in New Issue
Block a user