FuelClient.hh
Go to the documentation of this file.
High level interface to ignition fuel.
Definition: ClientConfig.hh:110
Defines how to identify a collection.
Definition: CollectionIdentifier.hh:43
Result CachedWorld(const common::URI &_worldUrl, std::string &_path)
Check if a world is already present in the local cache.
ModelIter Models(const ServerConfig &_server)
Returns an iterator that can return names of models.
void PopulateLicenses(const ServerConfig &_server)
This function requests the available licenses from the Fuel server and stores this information locall...
WorldIter Worlds(const WorldIdentifier &_id) const
Returns worlds matching a given identifying criteria.
Result DownloadModel(const ModelIdentifier &_id, const std::vector< std::string > &_headers)
Download a model from ignition fuel. This will override an existing local copy of the model.
Result DownloadWorld(const common::URI &_worldUrl, std::string &_path)
Download a world from ignition fuel. This will override an existing local copy of the world.
ModelIter Models(const ServerConfig &_server) const
Returns an iterator that can return names of models.
Result PatchModel(const ModelIdentifier &_model, const std::vector< std::string > &_headers)
Update a model using a PATCH request.
bool CachedModel(const common::URI &_modelUrl)
Check if a model exists in the cache.
bool ParseWorldFileUrl(const common::URI &_worldFileUrl, WorldIdentifier &_id, std::string &_filePath)
Parse world file identifier from world file URL.
bool ParseModelFileUrl(const common::URI &_modelFileUrl, ModelIdentifier &_id, std::string &_filePath)
Parse model file identifier from model file URL.
Result PatchModel(const ModelIdentifier &_model, const std::vector< std::string > &_headers, const std::string &_pathToModelDir)
Update a model using a PATCH request.
Result ModelDetails(const ModelIdentifier &_id, ModelIdentifier &_model, const std::vector< std::string > &_headers) const
Fetch the details of a model.
FuelClient(const ClientConfig &_config, const Rest &_rest=Rest(), LocalCache *_cache=nullptr)
Constructor accepts server and auth configuration.
ModelIter Models(const ModelIdentifier &_id) const
Returns models matching a given identifying criteria.
Result WorldDetails(const WorldIdentifier &_id, WorldIdentifier &_world) const
Fetch the details of a world.
Result DeleteModel(const ModelIdentifier &_id)
Remove a model from ignition fuel.
Result DeleteUrl(const ignition::common::URI &_uri, const std::vector< std::string > &_headers)
Remove a resource, such as a model or world, from Ignition Fuel.
ModelIter Models(const CollectionIdentifier &_id) const
Returns an iterator for the models found in a collection.
Result DownloadModel(const ModelIdentifier &_id)
Download a model from ignition fuel. This will override an existing local copy of the model.
WorldIter Worlds(const CollectionIdentifier &_id) const
Returns an iterator for the worlds found in a collection.
Result ModelDetails(const ModelIdentifier &_id, ModelIdentifier &_model) const
Fetch the details of a model.
Result DownloadModel(const common::URI &_modelUrl, std::string &_path)
Download a model from ignition fuel. This will override an existing local copy of the model.
bool ParseWorldUrl(const common::URI &_worldUrl, WorldIdentifier &_id)
Parse world identifier from world URL or unique name.
Result CachedWorldFile(const common::URI &_fileUrl, std::string &_path)
Check if a file belonging to a world is already present in the local cache.
Result DownloadWorld(WorldIdentifier &_id)
Download a world from Ignition Fuel. This will override an existing local copy of the world.
Result CachedModel(const common::URI &_modelUrl, std::string &_path)
Check if a model is already present in the local cache.
bool ParseCollectionUrl(const common::URI &_url, CollectionIdentifier &_id)
Parse Collection identifer from URL.
WorldIter Worlds(const ServerConfig &_server) const
Returns an iterator that can return information of worlds.
Result CachedModelFile(const common::URI &_fileUrl, std::string &_path)
Check if a file belonging to a model is already present in the local cache.
bool ParseModelUrl(const common::URI &_modelUrl, ModelIdentifier &_id)
Parse model identifier from model URL or unique name.
bool CachedWorld(const common::URI &_worldUrl)
Check if a world exists in the cache.
ModelIter Models(const ModelIdentifier &_id)
Returns models matching a given identifying criteria.
ClientConfig & Config()
Get a mutable reference to the client configuration.
Result UploadModel(const std::string &_pathToModelDir, const ModelIdentifier &_id, const std::vector< std::string > &_headers, bool _private=false)
Upload a directory as a new model.
Class for managing stuff in the local cache.
Definition: LocalCache.hh:47
Defines how to identify a model.
Definition: ModelIdentifier.hh:46
Describes options needed for a server.
Definition: ClientConfig.hh:48
Defines how to identify a world.
Definition: WorldIdentifier.hh:43