mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Draft PR to show API changes for #7766 #13469 --------- Co-authored-by: Lucas Rodriguez <lucas@fleetdm.com> Co-authored-by: Mike McNeil <mikermcneil@users.noreply.github.com>
This commit is contained in:
parent
637430f442
commit
10ed97e570
@ -742,6 +742,22 @@ If the live query feature is disabled or not.
|
||||
live_query_disabled: true
|
||||
```
|
||||
|
||||
##### server_settings.query_reports_disabled
|
||||
|
||||
Whether the query reports feature is disabled.
|
||||
If this setting is changed from `false` to `true`, then all stored query results will be deleted (this process can take up to one hour).
|
||||
|
||||
Query reports are cached results of scheduled queries stored in Fleet (up to 1000).
|
||||
|
||||
- Optional setting (boolean)
|
||||
- Default value: `false`
|
||||
- Config file format:
|
||||
```yaml
|
||||
server_settings:
|
||||
query_reports_disabled: true
|
||||
```
|
||||
|
||||
|
||||
##### server_settings.server_url
|
||||
|
||||
The base URL of the fleet server, including the scheme (e.g. "https://").
|
||||
|
@ -858,6 +858,8 @@ Returns the name, description, and SQL of the query specified by name.
|
||||
|
||||
Creates and/or modifies the queries included in the list. To modify an existing query, the name of the query must already be used by an existing query. If a query with the specified name doesn't exist in Fleet, a new query will be created.
|
||||
|
||||
If a query field is not specified in the "spec" then its default value depending on its type will be assumed, e.g. if `interval` is not set then `0` will be assumed, if `discard_data` is omitted then `false` will be assumed, etc.
|
||||
|
||||
`POST /api/v1/fleet/spec/queries`
|
||||
|
||||
#### Parameters
|
||||
@ -866,6 +868,8 @@ Creates and/or modifies the queries included in the list. To modify an existing
|
||||
| ----- | ---- | ---- | ---------------------------------------------------------------- |
|
||||
| specs | list | body | **Required.** The list of the queries to be created or modified. |
|
||||
|
||||
For more information about the query fields, please refer to the [Create query endpoint](https://fleetdm.com/docs/using-fleet/rest-api#create-query).
|
||||
|
||||
#### Example
|
||||
|
||||
`POST /api/v1/fleet/spec/queries`
|
||||
|
@ -827,6 +827,7 @@ None.
|
||||
"server_settings": {
|
||||
"server_url": "https://localhost:8080",
|
||||
"live_query_disabled": false,
|
||||
"query_reports_disabled": false,
|
||||
"enable_analytics": true
|
||||
},
|
||||
"smtp_settings": {
|
||||
@ -1021,6 +1022,7 @@ Modifies the Fleet's configuration with the supplied information.
|
||||
| contact_url | string | body | _Organization information_. A URL that can be used by end users to contact the organization. |
|
||||
| server_url | string | body | _Server settings_. The Fleet server URL. |
|
||||
| live_query_disabled | boolean | body | _Server settings_. Whether the live query capabilities are disabled. |
|
||||
| query_reports_disabled | boolean | body | _Server settings_. Whether query report capabilities are disabled. |
|
||||
| enable_smtp | boolean | body | _SMTP settings_. Whether SMTP is enabled for the Fleet app. |
|
||||
| sender_address | string | body | _SMTP settings_. The sender email address for the Fleet app. An invitation email is an example of the emails that may use this sender address |
|
||||
| server | string | body | _SMTP settings_. The SMTP server for the Fleet app. |
|
||||
@ -1117,7 +1119,8 @@ Note that when making changes to the `integrations` object, all integrations mus
|
||||
},
|
||||
"server_settings": {
|
||||
"server_url": "https://localhost:8080",
|
||||
"live_query_disabled": false
|
||||
"live_query_disabled": false,
|
||||
"query_reports_disabled": false
|
||||
},
|
||||
"smtp_settings": {
|
||||
"enable_smtp": true,
|
||||
@ -5514,6 +5517,7 @@ Returns the query specified by ID.
|
||||
"logging": "snapshot",
|
||||
"saved": true,
|
||||
"observer_can_run": true,
|
||||
"discard_data": false,
|
||||
"author_id": 1,
|
||||
"author_name": "John",
|
||||
"author_email": "john@example.com",
|
||||
@ -5666,6 +5670,7 @@ Returns a list of global queries or team queries.
|
||||
"logging": "snapshot",
|
||||
"saved": true,
|
||||
"observer_can_run": true,
|
||||
"discard_data": false,
|
||||
"author_id": 1,
|
||||
"author_name": "noah",
|
||||
"author_email": "noah@example.com",
|
||||
@ -5703,6 +5708,7 @@ Returns a list of global queries or team queries.
|
||||
"logging": "differential",
|
||||
"saved": true,
|
||||
"observer_can_run": true,
|
||||
"discard_data": true,
|
||||
"author_id": 1,
|
||||
"author_name": "noah",
|
||||
"author_email": "noah@example.com",
|
||||
@ -5729,6 +5735,7 @@ Returns a list of global queries or team queries.
|
||||
```
|
||||
|
||||
### Create query
|
||||
|
||||
Creates a global query or team query.
|
||||
|
||||
`POST /api/v1/fleet/queries`
|
||||
@ -5746,7 +5753,9 @@ Creates a global query or team query.
|
||||
| platform | string | body | The OS platforms where this query will run (other platforms ignored). Comma-separated string. If omitted, runs on all compatible platforms. |
|
||||
| min_osquery_version | string | body | The minimum required osqueryd version installed on a host. If omitted, all osqueryd versions are acceptable. |
|
||||
| automations_enabled | boolean | body | Whether to send data to the configured log destination according to the query's `interval`. |
|
||||
| logging | string | body | The type of log output for this query. Valid values: `"snapshot"`(default), `"differential"`, or `"differential_ignore_removals"`. |
|
||||
| logging | string | body | The type of log output for this query. Valid values: `"snapshot"`(default), `"differential", or "differential_ignore_removals"`. |
|
||||
| discard_data | bool | body | Whether to skip saving the latest query results for each host. Default: `false`. |
|
||||
|
||||
|
||||
#### Example
|
||||
|
||||
@ -5763,7 +5772,8 @@ Creates a global query or team query.
|
||||
"platform": "darwin,windows,linux",
|
||||
"min_osquery_version": "",
|
||||
"automations_enabled": true,
|
||||
"logging": "snapshot"
|
||||
"logging": "snapshot",
|
||||
"discard_data": false
|
||||
}
|
||||
```
|
||||
|
||||
@ -5791,6 +5801,7 @@ Creates a global query or team query.
|
||||
"author_name": "",
|
||||
"author_email": "",
|
||||
"observer_can_run": true,
|
||||
"discard_data": false,
|
||||
"packs": []
|
||||
}
|
||||
}
|
||||
@ -5815,7 +5826,13 @@ Modifies the query specified by ID.
|
||||
| platform | string | body | The OS platforms where this query will run (other platforms ignored). Comma-separated string. If set to "", runs on all compatible platforms. |
|
||||
| min_osquery_version | string | body | The minimum required osqueryd version installed on a host. If omitted, all osqueryd versions are acceptable. |
|
||||
| automations_enabled | boolean | body | Whether to send data to the configured log destination according to the query's `interval`. |
|
||||
| logging | string | body | The type of log output for this query. Valid values: `"snapshot"`(default), `"differential", or "differential_ignore_removals"`. |
|
||||
| logging | string | body | The type of log output for this query. Valid values: `"snapshot"`(default), `"differential"`, or `"differential_ignore_removals"`. |
|
||||
| discard_data | bool | body | Whether to skip saving the latest query results for each host. |
|
||||
|
||||
> Note that any of the following conditions will cause the existing query report to be deleted:
|
||||
> - Updating the `query` (SQL) field
|
||||
> - Changing `discard_data` from `false` to `true`
|
||||
> - Changing `logging` from `"snapshot"` to `"differential"` or `"differential_ignore_removals"`
|
||||
|
||||
#### Example
|
||||
|
||||
@ -5829,7 +5846,8 @@ Modifies the query specified by ID.
|
||||
"interval": 3600, // Once per hour,
|
||||
"platform": "",
|
||||
"min_osquery_version": "",
|
||||
"automations_enabled": false
|
||||
"automations_enabled": false,
|
||||
"discard_data": true
|
||||
}
|
||||
```
|
||||
|
||||
@ -5856,6 +5874,7 @@ Modifies the query specified by ID.
|
||||
"author_id": 1,
|
||||
"author_name": "noah",
|
||||
"observer_can_run": true,
|
||||
"discard_data": true,
|
||||
"packs": []
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user