mirror of
https://github.com/fleetdm/fleet
synced 2026-05-14 20:48:35 +00:00
* removed global api routes; using 'latest' instead of v1 for api routes * lint fixes * updated docs and tests * lint fixes * route fix * fixed routes breaking packs queries * revert test change |
||
|---|---|---|
| .. | ||
| entities | ||
| base.js | ||
| endpoints.ts | ||
| helpers.tests.js | ||
| helpers.ts | ||
| index.js | ||
| index.tests.js | ||
| README.md | ||
| request.js | ||
| status.js | ||
Fleet API Client
The Fleet API Client is used for communicating with the Fleet API. Fleet has a number of entities (hosts, labels, packs, queries, users, etc), all of which have CRUD methods to perform on a specific entity or collection of entities.
Entities are assigned to the API Client in the constructor function. Each
entity's methods can be found in the /frontend/fleet/entities directory.
The CRUD methods that are typically implemented in the API client are as follows:
create
- The
createmethod is used for creating a new entity. The input parameter is typically an object containing the attributes for the new entity.
destroy
- The
destroymethod is used for deleting an entity. Then input parameter is typically the entity to be deleted.
load
- The
loadmethod is used for loading a single entity. The input parameter is typically theidof the entity to load.
loadAll
- The
loadAllmethod is used for loading all of the entities.
update
- The
updatemethod is used to update an entity. The input parameters are typically the entity being updated and an object with the updated attributes.