add geolocation information to Hosts responses (#7190)

This commit is contained in:
Roberto Dip 2022-08-17 16:10:22 -03:00 committed by GitHub
parent de6e9b7a26
commit 953fc895ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1805,12 +1805,22 @@ If `mdm_id` is specified, an additional top-level key `"mobile_device_management
"issues": {
"failing_policies_count": 2,
"total_issues_count": 2
},
"geolocation": {
"country_iso": "US",
"city_name": "New York",
"geometry": {
"type": "point",
"coordinates": [40.6799, -74.0028]
}
}
}
]
}
```
> Note: the response above assumes a [GeoIP database is configured](https://fleetdm.com/docs/deploying/configuration#geo-ip), otherwise the `geolocation` object won't be included.
### Count hosts
`GET /api/v1/fleet/hosts/count`
@ -2141,11 +2151,21 @@ If the scheduled queries haven't run on the host yet, the stats have zero values
"cycle_count": 999,
"health": "Normal"
}
]
],
"geolocation": {
"country_iso": "US",
"city_name": "New York",
"geometry": {
"type": "point",
"coordinates": [40.6799, -74.0028]
}
}
}
}
```
> Note: the response above assumes a [GeoIP database is configured](https://fleetdm.com/docs/deploying/configuration#geo-ip), otherwise the `geolocation` object won't be included.
### Get host by identifier
Returns the information of the host specified using the `uuid`, `osquery_host_id`, `hostname`, or
@ -2214,11 +2234,21 @@ Returns the information of the host specified using the `uuid`, `osquery_host_id
"cycle_count": 999,
"health": "Normal"
}
]
],
"geolocation": {
"country_iso": "US",
"city_name": "New York",
"geometry": {
"type": "point",
"coordinates": [40.6799, -74.0028]
}
}
}
}
```
> Note: the response above assumes a [GeoIP database is configured](https://fleetdm.com/docs/deploying/configuration#geo-ip), otherwise the `geolocation` object won't be included.
### Delete host
Deletes the specified host from Fleet. Note that a deleted host will fail authentication with the previous node key, and in most osquery configurations will attempt to re-enroll automatically. If the host still has a valid enroll secret, it will re-enroll successfully.