Skip to content

Commit 21e8b0f

Browse files
nkoenigNate Koenig
andauthored
Support editing/patching model files (#140)
* Support editing/patching model files Signed-off-by: Nate Koenig <nate@openrobotics.org> * Added documentation Signed-off-by: Nate Koenig <nate@openrobotics.org> * Set keep alive on Signed-off-by: Nate Koenig <nate@openrobotics.org> * Documentation and tests Signed-off-by: Nate Koenig <nate@openrobotics.org> * One more test and exit catch missing -u Signed-off-by: Nate Koenig <nate@openrobotics.org> Co-authored-by: Nate Koenig <nate@openrobotics.org>
1 parent bdf5303 commit 21e8b0f

File tree

6 files changed

+294
-136
lines changed

6 files changed

+294
-136
lines changed

include/ignition/fuel_tools/FuelClient.hh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,24 @@ namespace ignition
348348
const ignition::fuel_tools::ModelIdentifier &_model,
349349
const std::vector<std::string> &_headers);
350350

351+
/// \brief Update a model using a PATCH request.
352+
///
353+
/// Model fields that are patched by this function:
354+
/// * private
355+
/// * Model files contained in _pathToModelDir.
356+
/// * Description, tags, license, and other attributes found in the
357+
/// metadata.pbtxt or model.config file.
358+
///
359+
/// \param[in] _model The model to patch. The contents of this model
360+
/// will be sent in the PATCH request.
361+
/// \param[in] _headers Headers to set on the HTTP request.
362+
/// \param[in] _pathToModelDir a path to a directory containing a model.
363+
/// \return Result of the patch operation.
364+
public: Result PatchModel(
365+
const ignition::fuel_tools::ModelIdentifier &_model,
366+
const std::vector<std::string> &_headers,
367+
const std::string &_pathToModelDir);
368+
351369
/// \brief Parse Collection identifer from URL.
352370
/// \param[in] _url The unique URL of a collection. It may also be a
353371
/// unique name, which is a URL without the server version.

0 commit comments

Comments
 (0)