add upgrade tests (#6596)
* add upgrade tests * fix lint issues go.mod * remove req.cnf * revert unrelated changes * make version configurable in test * fix golangci-lint ruleguard issue Related to https://github.com/go-critic/go-critic/issues/1152 Need to have github.com/quasilyte/go-ruleguard/dsl * fix lint issues * fix * clean up docker-compose.yml * fix http request * add readme * fix lint issues * address feedback * fix * add platform * address feedback * run go fmt
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/fleetdm/fleet/v4/server/fleet"
|
||||
"github.com/fleetdm/fleet/v4/server/ptr"
|
||||
)
|
||||
@@ -13,6 +15,13 @@ func (c *Client) GetHosts(query string) ([]HostResponse, error) {
|
||||
return responseBody.Hosts, err
|
||||
}
|
||||
|
||||
func (c *Client) GetHost(id uint) (*HostDetailResponse, error) {
|
||||
verb, path := "GET", fmt.Sprintf("/api/latest/fleet/hosts/%d", id)
|
||||
var responseBody getHostResponse
|
||||
err := c.authenticatedRequest(nil, verb, path, &responseBody)
|
||||
return responseBody.Host, err
|
||||
}
|
||||
|
||||
// HostByIdentifier retrieves a host by the uuid, osquery_host_id, hostname, or
|
||||
// node_key.
|
||||
func (c *Client) HostByIdentifier(identifier string) (*HostDetailResponse, error) {
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/fleetdm/fleet/v4/server/fleet"
|
||||
)
|
||||
|
||||
// ListSoftware retrieves the software running across hosts.
|
||||
func (c *Client) ListSoftware(teamID *uint) ([]fleet.Software, error) {
|
||||
func (c *Client) ListSoftware(query string) ([]fleet.Software, error) {
|
||||
verb, path := "GET", "/api/latest/fleet/software"
|
||||
query := ""
|
||||
if teamID != nil {
|
||||
query = fmt.Sprintf("team_id=%d", *teamID)
|
||||
}
|
||||
var responseBody listSoftwareResponse
|
||||
err := c.authenticatedRequestWithQuery(nil, verb, path, &responseBody, query)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user