fleet/frontend/fleet
Martavis Parker a8d7b5478b
Updated API routes to use current format for frontend use (#5018)
* 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
2022-04-11 13:04:38 -07:00
..
entities Updated API routes to use current format for frontend use (#5018) 2022-04-11 13:04:38 -07:00
base.js Rename main frontend directory (#977) 2021-06-06 17:30:54 -07:00
endpoints.ts Updated API routes to use current format for frontend use (#5018) 2022-04-11 13:04:38 -07:00
helpers.tests.js Improve UX for async filtering in select targets component (#4349) 2022-02-25 13:04:05 -06:00
helpers.ts Improve UI responsiveness for tables at narrower screen sizes (#4926) 2022-04-07 14:12:38 -05:00
index.js 1497 improved query experience (#1998) 2021-09-10 12:06:37 -07:00
index.tests.js Remove Kolide from frontend directory, fix sentence casing as needed (#4338) 2022-02-24 09:11:57 -05:00
README.md Remove Kolide from frontend directory, fix sentence casing as needed (#4338) 2022-02-24 09:11:57 -05:00
request.js Handle response.body if it is not JSON (#3599) 2022-01-11 13:52:28 -06:00
status.js Rename main frontend directory (#977) 2021-06-06 17:30:54 -07:00

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 create method is used for creating a new entity. The input parameter is typically an object containing the attributes for the new entity.

destroy

  • The destroy method is used for deleting an entity. Then input parameter is typically the entity to be deleted.

load

  • The load method is used for loading a single entity. The input parameter is typically the id of the entity to load.

loadAll

  • The loadAll method is used for loading all of the entities.

update

  • The update method is used to update an entity. The input parameters are typically the entity being updated and an object with the updated attributes.